61c73d8e9d6e1edcccf76569d42aba1138f06e9b
[maevies] / src / extra_scenes_provider.c
1 /*
2  * extra_scenes_provider.c
3  *
4  * This file is part of maevies
5  * Copyright (C) 2009 Simón Pena <bulfaiter@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  */
18
19 #include "extra_scenes_provider.h"
20 #include "watc_provider.h"
21
22 gboolean has_stingers(const gchar *movie) {
23
24         /* There should be a mechanism here
25          * allowing us to dynamically load new libraries
26          * dlopen - http://stackoverflow.com/questions/384121/creating-a-module-system-dynamic-loading-in-c
27          * Until we get it, we'll use just one of the provided providers ;)
28          */
29         GSList *result_list = watc_has_stingers(movie);
30         WATCInfo *result = NULL;
31         gboolean value = FALSE;
32
33         if (g_slist_length(result_list) == 1) {
34
35                 result = (WATCInfo *) g_slist_nth(result_list, 0);
36                 if (result != NULL)
37                         value = result->has_stingers;
38         }
39
40         watcinfo_list_unref(result_list);
41
42         return value;
43 }