Commit b2b93741 authored by Victor Toso's avatar Victor Toso

thetvdb: Include The TVDB source

https://bugzilla.gnome.org/show_bug.cgi?id=672933
parent f7582948
......@@ -53,6 +53,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-apple-trailers \
--enable-optical-media \
--enable-pocket \
--enable-podcasts \
--enable-thetvdb \
--enable-tmdb \
--enable-tracker \
--enable-upnp \
......
......@@ -1272,6 +1272,55 @@ AC_SUBST(DEPS_DMAP_CFLAGS)
DEPS_DMAP_LIBS="$DEPS_LIBS $DMAP_LIBS $XML_LIBS"
AC_SUBST(DEPS_DMAP_LIBS)
# ----------------------------------------------------------
# BUILD THETVDB PLUGIN
# ----------------------------------------------------------
AC_ARG_ENABLE(thetvdb,
AC_HELP_STRING([--enable-thetvdb],
[enable thetvdb plugin (default: auto)]),
[
case "$enableval" in
yes)
if test "x$HAVE_GRLNET" = "xno"; then
AC_MSG_ERROR([grilo-net-0.2 >= 0.2.2 not found, install it or use --disable-thetvdb])
fi
if test "x$HAVE_XML" = "xno"; then
AC_MSG_ERROR([libxml-2.0 not found, install it or use --disable-thetvdb])
fi
if test "x$HAVE_ARCHIVE" = "xno"; then
AC_MSG_ERROR([libarchive not found, install it or use --disable-thetvdb])
fi
if test "x$HAVE_GOM" = "xno"; then
AC_MSG_ERROR([gom-1.0 not found, install it or use --disable-thetvdb])
fi
;;
esac
],
[
if test "x$HAVE_GRLNET" = "xyes" -a "x$HAVE_XML" = "xyes" -a "x$HAVE_ARCHIVE" = "xyes" -a "x$HAVE_GOM" = "xyes"; then
enable_thetvdb=yes
else
enable_thetvdb=no
fi
])
AM_CONDITIONAL([THETVDB_PLUGIN], [test "x$enable_thetvdb" = "xyes"])
GRL_PLUGINS_ALL="$GRL_PLUGINS_ALL thetvdb"
if test "x$enable_thetvdb" = "xyes"
then
GRL_PLUGINS_ENABLED="$GRL_PLUGINS_ENABLED thetvdb"
fi
THETVDB_PLUGIN_ID="grl-thetvdb"
AC_SUBST(THETVDB_PLUGIN_ID)
AC_DEFINE_UNQUOTED([THETVDB_PLUGIN_ID], ["$THETVDB_PLUGIN_ID"], [thetvdb plugin ID])
DEPS_THETVDB_CFLAGS="$DEPS_CFLAGS $ARCHIVE_CFLAGS $GRLNET_CFLAGS $XML_CFLAGS $GOM_CFLAGS"
AC_SUBST(DEPS_THETVDB_CFLAGS)
DEPS_THETVDB_LIBS="$DEPS_LIBS $ARCHIVE_LIBS $GRLNET_LIBS $XML_LIBS $GOM_LIBS"
AC_SUBST(DEPS_THETVDB_LIBS)
# ----------------------------------------------------------
# BUILD TMDB PLUGIN
# ----------------------------------------------------------
......@@ -1399,6 +1448,7 @@ AC_CONFIG_FILES([
src/lua-factory/Makefile
src/lua-factory/sources/Makefile
src/magnatune/Makefile
src/thetvdb/Makefile
src/metadata-store/Makefile
src/optical-media/Makefile
src/pocket/Makefile
......@@ -1416,6 +1466,7 @@ AC_CONFIG_FILES([
tests/dleyna/Makefile
tests/dleyna/dbusmock/dleyna-server-mock.service
tests/local-metadata/Makefile
tests/thetvdb/Makefile
tests/tmdb/Makefile
tests/vimeo/Makefile
])
......
......@@ -86,6 +86,10 @@ if SHOUTCAST_PLUGIN
SUBDIRS += shoutcast
endif
if THETVDB_PLUGIN
SUBDIRS += thetvdb
endif
if TMDB_PLUGIN
SUBDIRS += tmdb
endif
......@@ -113,7 +117,7 @@ endif
DIST_SUBDIRS = \
apple-trailers bliptv bookmarks dleyna dmap filesystem flickr freebox gravatar jamendo \
lastfm-albumart local-metadata lua-factory magnatune metadata-store optical-media \
pocket podcasts raitv shoutcast tmdb tracker upnp vimeo youtube
pocket podcasts raitv shoutcast thetvdb tmdb tracker upnp vimeo youtube
MAINTAINERCLEANFILES = \
*.in \
......
#
# Makefile.am
#
# Author: Victor Toso <me@victortoso.com>
#
# Copyright (C) 2014 Victor Toso. All rights reserved.
include $(top_srcdir)/gtester.mk
ext_LTLIBRARIES = libgrlthetvdb.la
libgrlthetvdb_la_CFLAGS = \
$(DEPS_THETVDB_CFLAGS) \
-DG_LOG_DOMAIN=\"GrlTheTVDB\" \
-DLOCALEDIR=\"$(localedir)\"
libgrlthetvdb_la_LIBADD = \
$(DEPS_THETVDB_LIBS)
libgrlthetvdb_la_LDFLAGS = \
-no-undefined \
-module \
-avoid-version
libgrlthetvdb_la_SOURCES = \
grl-thetvdb.c \
grl-thetvdb.h \
thetvdb-resources-series.c \
thetvdb-resources-episodes.c \
thetvdb-resources.h
extdir = $(GRL_PLUGINS_DIR)
thetvdbxmldir = $(GRL_PLUGINS_DIR)
thetvdbxml_DATA = $(THETVDB_PLUGIN_ID).xml
# Rules to enable tests
copy-xml-to-libs-dir: libgrlthetvdb.la
cp -f $(srcdir)/$(thetvdbxml_DATA) $(builddir)/.libs/
all-local: copy-xml-to-libs-dir
EXTRA_DIST = $(thetvdbxml_DATA)
MAINTAINERCLEANFILES = \
*.in \
*~
DISTCLEANFILES = $(MAINTAINERCLEANFILES)
This diff is collapsed.
/*
* Copyright (C) 2014 Victor Toso.
*
* Contact: Victor Toso <me@victortoso.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef _GRL_THETVDB_SOURCE_H_
#define _GRL_THETVDB_SOURCE_H_
#include <grilo.h>
#define GRL_THETVDB_SOURCE_TYPE \
(grl_thetvdb_source_get_type ())
#define GRL_THETVDB_SOURCE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
GRL_THETVDB_SOURCE_TYPE, \
GrlTheTVDBSource))
#define GRL_THETVDB_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), \
GRL_THETVDB_SOURCE_TYPE, \
GrlTheTVDBSourceClass))
#define GRL_IS_THETVDB_SOURCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), \
GRL_THETVDB_SOURCE_TYPE))
#define GRL_THETVDB_SOURCE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS((obj), \
GRL_THETVDB_SOURCE_TYPE, \
GrlTheTVDBSourceClass))
typedef struct _GrlTheTVDBPrivate GrlTheTVDBPrivate;
typedef struct _GrlTheTVDBSource GrlTheTVDBSource;
struct _GrlTheTVDBSource {
GrlSource parent;
GrlTheTVDBPrivate *priv;
};
typedef struct _GrlTheTVDBSourceClass GrlTheTVDBSourceClass;
struct _GrlTheTVDBSourceClass {
GrlSourceClass parent_class;
};
GType grl_thetvdb_source_get_type (void);
#endif /* _GRL_THETVDB_SOURCE_H_ */
<plugin>
<info>
<name>The TVDB</name>
<module>libgrlthetvdb</module>
<description>A plugin for fetching metadata of television shows</description>
<author>Victor Toso</author>
<license>LGPL</license>
<site>http://victortoso.com</site>
</info>
</plugin>
/*
* Copyright (C) 2014 Victor Toso.
*
* Contact: Victor Toso <me@victortoso.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#include "thetvdb-resources.h"
G_DEFINE_TYPE (EpisodeResource, episode_resource, GOM_TYPE_RESOURCE)
struct _EpisodeResourcePrivate {
gint64 db_id;
gdouble rating;
gchar *series_id;
gchar *overview;
gchar *language;
gchar *imdb_id;
gchar *first_aired;
guint season_number;
guint episode_number;
guint absolute_number;
gchar *season_id;
gchar *episode_id;
gchar *episode_name;
gchar *url_episode_screen;
gchar *director_names;
gchar *guest_stars_names;
};
enum {
PROP_0,
PROP_DB_ID,
PROP_LANGUAGE,
PROP_SERIES_ID,
PROP_OVERVIEW,
PROP_IMDB_ID,
PROP_FIRST_AIRED,
PROP_RATING,
PROP_SEASON_NUMBER,
PROP_EPISODE_NUMBER,
PROP_ABSOLUTE_NUMBER,
PROP_SEASON_ID,
PROP_EPISODE_ID,
PROP_EPISODE_NAME,
PROP_URL_EPISODE_SCREEN,
PROP_DIRECTOR_NAMES,
PROP_GUEST_STARS_NAMES,
LAST_PROP
};
static GParamSpec *specs[LAST_PROP];
static void
episode_resource_finalize (GObject *object)
{
EpisodeResourcePrivate *priv = EPISODE_RESOURCE(object)->priv;
g_clear_pointer (&priv->language, g_free);
g_clear_pointer (&priv->series_id, g_free);
g_clear_pointer (&priv->overview, g_free);
g_clear_pointer (&priv->imdb_id, g_free);
g_clear_pointer (&priv->first_aired, g_free);
g_clear_pointer (&priv->season_id, g_free);
g_clear_pointer (&priv->episode_id, g_free);
g_clear_pointer (&priv->episode_name, g_free);
g_clear_pointer (&priv->url_episode_screen, g_free);
g_clear_pointer (&priv->director_names, g_free);
g_clear_pointer (&priv->guest_stars_names, g_free);
G_OBJECT_CLASS(episode_resource_parent_class)->finalize(object);
}
static void
episode_resource_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
EpisodeResource *resource = EPISODE_RESOURCE(object);
switch (prop_id) {
case PROP_DB_ID:
g_value_set_int64 (value, resource->priv->db_id);
break;
case PROP_LANGUAGE:
g_value_set_string (value, resource->priv->language);
break;
case PROP_SERIES_ID:
g_value_set_string (value, resource->priv->series_id);
break;
case PROP_OVERVIEW:
g_value_set_string (value, resource->priv->overview);
break;
case PROP_IMDB_ID:
g_value_set_string (value, resource->priv->imdb_id);
break;
case PROP_FIRST_AIRED:
g_value_set_string (value, resource->priv->first_aired);
break;
case PROP_RATING:
g_value_set_double (value, resource->priv->rating);
break;
case PROP_SEASON_NUMBER:
g_value_set_uint (value, resource->priv->season_number);
break;
case PROP_EPISODE_NUMBER:
g_value_set_uint (value, resource->priv->episode_number);
break;
case PROP_ABSOLUTE_NUMBER:
g_value_set_uint (value, resource->priv->absolute_number);
break;
case PROP_SEASON_ID:
g_value_set_string (value, resource->priv->season_id);
break;
case PROP_EPISODE_ID:
g_value_set_string (value, resource->priv->episode_id);
break;
case PROP_EPISODE_NAME:
g_value_set_string (value, resource->priv->episode_name);
break;
case PROP_URL_EPISODE_SCREEN:
g_value_set_string (value, resource->priv->url_episode_screen);
break;
case PROP_DIRECTOR_NAMES:
g_value_set_string (value, resource->priv->director_names);
break;
case PROP_GUEST_STARS_NAMES:
g_value_set_string (value, resource->priv->guest_stars_names);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void
episode_resource_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
EpisodeResource *resource = EPISODE_RESOURCE(object);
switch (prop_id) {
case PROP_DB_ID:
resource->priv->db_id = g_value_get_int64 (value);
break;
case PROP_LANGUAGE:
g_clear_pointer (&resource->priv->language, g_free);
resource->priv->language = g_value_dup_string (value);
break;
case PROP_SERIES_ID:
g_clear_pointer (&resource->priv->series_id, g_free);
resource->priv->series_id = g_value_dup_string (value);
break;
case PROP_OVERVIEW:
g_clear_pointer (&resource->priv->overview, g_free);
resource->priv->overview = g_value_dup_string (value);
break;
case PROP_IMDB_ID:
g_clear_pointer (&resource->priv->imdb_id, g_free);
resource->priv->imdb_id = g_value_dup_string (value);
break;
case PROP_FIRST_AIRED:
g_clear_pointer (&resource->priv->first_aired, g_free);
resource->priv->first_aired = g_value_dup_string (value);
break;
case PROP_RATING:
resource->priv->rating = g_value_get_double (value);
break;
case PROP_SEASON_NUMBER:
resource->priv->season_number = g_value_get_uint (value);
break;
case PROP_EPISODE_NUMBER:
resource->priv->episode_number = g_value_get_uint (value);
break;
case PROP_ABSOLUTE_NUMBER:
resource->priv->absolute_number = g_value_get_uint (value);
break;
case PROP_SEASON_ID:
g_clear_pointer (&resource->priv->season_id, g_free);
resource->priv->season_id = g_value_dup_string (value);
break;
case PROP_EPISODE_ID:
g_clear_pointer (&resource->priv->episode_id, g_free);
resource->priv->episode_id = g_value_dup_string (value);
break;
case PROP_EPISODE_NAME:
g_clear_pointer (&resource->priv->episode_name, g_free);
resource->priv->episode_name = g_value_dup_string (value);
break;
case PROP_URL_EPISODE_SCREEN:
g_clear_pointer (&resource->priv->url_episode_screen, g_free);
resource->priv->url_episode_screen = g_value_dup_string (value);
break;
case PROP_DIRECTOR_NAMES:
g_clear_pointer (&resource->priv->director_names, g_free);
resource->priv->director_names = g_value_dup_string (value);
break;
case PROP_GUEST_STARS_NAMES:
g_clear_pointer (&resource->priv->guest_stars_names, g_free);
resource->priv->guest_stars_names = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void
episode_resource_class_init (EpisodeResourceClass *klass)
{
GObjectClass *object_class;
GomResourceClass *resource_class;
object_class = G_OBJECT_CLASS(klass);
object_class->finalize = episode_resource_finalize;
object_class->get_property = episode_resource_get_property;
object_class->set_property = episode_resource_set_property;
g_type_class_add_private(object_class, sizeof(EpisodeResourcePrivate));
resource_class = GOM_RESOURCE_CLASS(klass);
gom_resource_class_set_table(resource_class, "episodes");
specs[PROP_DB_ID] = g_param_spec_int64 (EPISODE_COLUMN_ID,
NULL, NULL,
0, G_MAXINT64,
0, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_DB_ID,
specs[PROP_DB_ID]);
gom_resource_class_set_primary_key (resource_class, EPISODE_COLUMN_ID);
specs[PROP_LANGUAGE] = g_param_spec_string (EPISODE_COLUMN_LANGUAGE,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_LANGUAGE,
specs[PROP_LANGUAGE]);
specs[PROP_SERIES_ID] = g_param_spec_string (EPISODE_COLUMN_SERIES_ID,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_SERIES_ID,
specs[PROP_SERIES_ID]);
specs[PROP_OVERVIEW] = g_param_spec_string (EPISODE_COLUMN_OVERVIEW,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_OVERVIEW,
specs[PROP_OVERVIEW]);
specs[PROP_IMDB_ID] = g_param_spec_string (EPISODE_COLUMN_IMDB_ID,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_IMDB_ID,
specs[PROP_IMDB_ID]);
specs[PROP_FIRST_AIRED] = g_param_spec_string (EPISODE_COLUMN_FIRST_AIRED,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_FIRST_AIRED,
specs[PROP_FIRST_AIRED]);
specs[PROP_RATING] = g_param_spec_double (EPISODE_COLUMN_RATING,
NULL, NULL,
0, G_MAXDOUBLE,
0, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_RATING,
specs[PROP_RATING]);
specs[PROP_SEASON_NUMBER] = g_param_spec_uint (EPISODE_COLUMN_SEASON_NUMBER,
NULL, NULL,
0, G_MAXUINT,
0, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_SEASON_NUMBER,
specs[PROP_SEASON_NUMBER]);
specs[PROP_EPISODE_NUMBER] = g_param_spec_uint (EPISODE_COLUMN_EPISODE_NUMBER,
NULL, NULL,
0, G_MAXUINT,
0, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_EPISODE_NUMBER,
specs[PROP_EPISODE_NUMBER]);
specs[PROP_ABSOLUTE_NUMBER] = g_param_spec_uint (EPISODE_COLUMN_ABSOLUTE_NUMBER,
NULL, NULL,
0, G_MAXUINT,
0, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_ABSOLUTE_NUMBER,
specs[PROP_ABSOLUTE_NUMBER]);
specs[PROP_SEASON_ID] = g_param_spec_string (EPISODE_COLUMN_SEASON_ID,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_SEASON_ID,
specs[PROP_SEASON_ID]);
specs[PROP_EPISODE_ID] = g_param_spec_string (EPISODE_COLUMN_EPISODE_ID,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_EPISODE_ID,
specs[PROP_EPISODE_ID]);
gom_resource_class_set_unique (resource_class, EPISODE_COLUMN_EPISODE_ID);
specs[PROP_EPISODE_NAME] = g_param_spec_string (EPISODE_COLUMN_EPISODE_NAME,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_EPISODE_NAME,
specs[PROP_EPISODE_NAME]);
specs[PROP_URL_EPISODE_SCREEN] = g_param_spec_string (EPISODE_COLUMN_URL_EPISODE_SCREEN,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_URL_EPISODE_SCREEN,
specs[PROP_URL_EPISODE_SCREEN]);
specs[PROP_DIRECTOR_NAMES] = g_param_spec_string (EPISODE_COLUMN_DIRECTOR_NAMES,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_DIRECTOR_NAMES,
specs[PROP_DIRECTOR_NAMES]);
specs[PROP_GUEST_STARS_NAMES] = g_param_spec_string (EPISODE_COLUMN_GUEST_STARS_NAMES,
NULL, NULL, NULL,
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_GUEST_STARS_NAMES,
specs[PROP_GUEST_STARS_NAMES]);
}
static void
episode_resource_init (EpisodeResource *resource)
{
resource->priv = G_TYPE_INSTANCE_GET_PRIVATE(resource,
EPISODE_TYPE_RESOURCE,
EpisodeResourcePrivate);
}
/*
* Copyright (C) 2014 Victor Toso.
*
* Contact: Victor Toso <me@victortoso.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#include "thetvdb-resources.h"
G_DEFINE_TYPE (SeriesResource, series_resource, GOM_TYPE_RESOURCE)
struct _SeriesResourcePrivate {
gint64 db_id;
gdouble rating;
gchar *series_id;
gchar *overview;
gchar *language;
gchar *imdb_id;
gchar *first_aired;
gchar *series_name;
gchar *status;
gchar *url_banner;
gchar *url_fanart;
gchar *url_poster;
gchar *zap2it_id;
gchar *actor_names;
gchar *alias_names;
gchar *genres;
};
enum {
PROP_0,
PROP_DB_ID,
PROP_LANGUAGE,
PROP_SERIES_NAME,
PROP_SERIES_ID,
PROP_STATUS,
PROP_OVERVIEW,
PROP_IMDB_ID,
PROP_ZAP2IT_ID,
PROP_FIRST_AIRED,
PROP_RATING,
PROP_ACTOR_NAMES,
PROP_GENRES,
PROP_URL_BANNER,
PROP_URL_FANART,
PROP_URL_POSTER,
LAST_PROP
};
static GParamSpec *specs[LAST_PROP];
static void
series_resource_finalize (GObject *object)
{
SeriesResourcePrivate *priv = SERIES_RESOURCE(object)->priv;
g_clear_pointer (&priv->language, g_free);
g_clear_pointer (&priv->series_name, g_free);
g_clear_pointer (&priv->series_id, g_free);
g_clear_pointer (&priv->status, g_free);
g_clear_pointer (&priv->overview, g_free);
g_clear_pointer (&priv->imdb_id, g_free);
g_clear_pointer (&priv->zap2it_id, g_free);
g_clear_pointer (&priv->first_aired, g_free);
g_clear_pointer (&priv->actor_names, g_free);
g_clear_pointer (&priv->alias_names, g_free);
g_clear_pointer (&priv->genres, g_free);
g_clear_pointer (&priv->url_banner, g_free);
g_clear_pointer (&priv->url_fanart, g_free);
g_clear_pointer (&priv->url_poster, g_free);
G_OBJECT_CLASS(series_resource_parent_class)->finalize(object);
}
static void
series_resource_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
SeriesResource *resource = SERIES_RESOURCE(object);
switch (prop_id) {
case PROP_DB_ID:
g_value_set_int64 (value, resource->priv->db_id);
break;
case PROP_LANGUAGE:
g_value_set_string (value, resource->priv->language);
break;
case PROP_SERIES_NAME:
g_value_set_string (value, resource->priv->series_name);
break;
case PROP_SERIES_ID:
g_value_set_string (value, resource->priv->series_id);
break;
case PROP_STATUS:
g_value_set_string (value, resource->priv->status);
break;
case PROP_OVERVIEW:
g_value_set_string (value, resource->priv->overview);
break;
case PROP_IMDB_ID:
g_value_set_string (value, resource->priv->imdb_id);
break;
case PROP_ZAP2IT_ID:
g_value_set_string (value, resource->priv->zap2it_id);
break;
case PROP_FIRST_AIRED:
g_value_set_string (value, resource->priv->first_aired);
break;
case PROP_RATING:
g_value_set_double (value, resource->priv->rating);
break;
case PROP_ACTOR_NAMES:
g_value_set_string (value, resource->priv->actor_names);
break;
case PROP_GENRES:
g_value_set_string (value, resource->priv->genres);
break;
case PROP_URL_BANNER:
g_value_set_string (value, resource->priv->url_banner);
break;
case PROP_URL_FANART:
g_value_set_string (value, resource->priv->url_fanart);
break;
case PROP_URL_POSTER:
g_value_set_string (value, resource->priv->url_poster);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
}
}
static void
series_resource_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{