Ejemplo n.º 1
0
static void
g_vimeo_init (GVimeo *vimeo)
{
  vimeo->priv = G_VIMEO_GET_PRIVATE (vimeo);
  vimeo->priv->per_page = 50;
  vimeo->priv->wc = grl_net_wc_new ();
  g_object_set (vimeo->priv->wc, "user-agent", PLUGIN_USER_AGENT, NULL);
}
Ejemplo n.º 2
0
static void
g_vimeo_init (GVimeo *vimeo)
{
  vimeo->priv = g_vimeo_get_instance_private (vimeo);
  vimeo->priv->per_page = 50;
  vimeo->priv->wc = grl_net_wc_new ();
  g_object_set (vimeo->priv->wc, "user-agent", PLUGIN_USER_AGENT, NULL);
}
Ejemplo n.º 3
0
inline static GrlNetWc *
get_wc (GFlickr *f)
{
  if (!f->priv->wc)
    f->priv->wc = grl_net_wc_new ();

  return f->priv->wc;
}
Ejemplo n.º 4
0
static void
grl_bliptv_source_init (GrlBliptvSource *self)
{
  self->priv = BLIPTV_SOURCE_PRIVATE (self);

  self->priv->wc = grl_net_wc_new ();

  grl_source_set_auto_split_threshold (GRL_SOURCE (self), MAX_ELEMENTS);
}
Ejemplo n.º 5
0
static void
magnatune_get_db_async(OperationSpec *os)
{
  GrlNetWc *wc = NULL;

  GRL_DEBUG("magnatune_get_db_async");

  wc = grl_net_wc_new();
  grl_net_wc_request_async(wc,
                           URL_GET_DB,
                           NULL,
                           magnatune_get_db_done,
                           os);
}
Ejemplo n.º 6
0
static void
magnatune_get_crc_async(void)
{
  GrlNetWc *wc = NULL;
  
  GRL_DEBUG("magnatune_get_crc_async");

  wc = grl_net_wc_new();
  grl_net_wc_request_async(wc,
                           URL_GET_CRC,
                           NULL,
                           magnatune_get_crc_done,
                           NULL);
}
Ejemplo n.º 7
0
static void
magnatune_check_update(void)
{
  gchar *db_path = NULL;
  gchar *new_db_path = NULL;
  gchar *new_crc_path = NULL;
  static gboolean already_checked = FALSE;
  struct stat file_st;
  GTimeVal tv;
  GrlNetWc *wc = NULL;

  GRL_DEBUG("magnatune_check_update");

  if (already_checked == TRUE)
    return;

  already_checked = TRUE;

  g_get_current_time(&tv);

  new_db_path = g_build_filename(g_get_user_data_dir(), "grilo-plugins",
                                 GRL_SQL_NEW_DB, NULL);

  if (g_file_test(new_db_path, G_FILE_TEST_EXISTS) == FALSE) {

    db_path = g_build_filename(g_get_user_data_dir(), "grilo-plugins",
                               GRL_SQL_DB, NULL);
    g_stat(db_path, &file_st);
    if (tv.tv_sec - file_st.st_mtime > DB_UPDATE_TIME_INTERVAL) {

      new_crc_path = g_build_filename(g_get_user_data_dir(), "grilo-plugins",
                                      GRL_SQL_NEW_CRC, NULL);
      g_stat(new_crc_path, &file_st);
      if ((g_file_test(new_crc_path, G_FILE_TEST_EXISTS) == FALSE)
           || (tv.tv_sec - file_st.st_mtime > CRC_UPDATE_TIME_INTERVAL)) {

        wc = grl_net_wc_new();
        grl_net_wc_request_async(wc,
                                 URL_GET_CRC,
                                 NULL,
                                 magnatune_check_update_done,
                                 NULL);
      }
      g_free(new_crc_path);
    }
    g_free(db_path);
  }
  g_free(new_db_path);
}
Ejemplo n.º 8
0
static void
grl_raitv_source_init (GrlRaitvSource *self)
{
  self->priv = RAITV_SOURCE_PRIVATE (self);

  self->priv->wc = grl_net_wc_new ();
  grl_net_wc_set_throttling (self->priv->wc, 1);

  //Insert search mapping
  self->priv->raitv_search_mappings = g_list_append (self->priv->raitv_search_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_ID, "HAS/C/@CID"));

  self->priv->raitv_search_mappings = g_list_append (self->priv->raitv_search_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_PUBLICATION_DATE, "MT[@N='itemDate']/@V"));

  self->priv->raitv_search_mappings = g_list_append (self->priv->raitv_search_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_TITLE, "MT[@N='title\']/@V"));

  self->priv->raitv_search_mappings = g_list_append (self->priv->raitv_search_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_URL, "MT[@N='videourl']/@V"));

  self->priv->raitv_search_mappings = g_list_append (self->priv->raitv_search_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_THUMBNAIL, "MT[@N='vod-image']/@V"));


  //Insert browse mapping
  self->priv->raitv_browse_mappings = g_list_append (self->priv->raitv_browse_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_ID, "localid"));
  self->priv->raitv_browse_mappings = g_list_append (self->priv->raitv_browse_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_PUBLICATION_DATE, "datacreazione"));
  self->priv->raitv_browse_mappings = g_list_append (self->priv->raitv_browse_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_TITLE, "titolo"));
  self->priv->raitv_browse_mappings = g_list_append (self->priv->raitv_browse_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_URL, "h264"));
  self->priv->raitv_browse_mappings = g_list_append (self->priv->raitv_browse_mappings,
                                                     raitv_build_mapping(GRL_METADATA_KEY_THUMBNAIL, "pathImmagine"));

}
Ejemplo n.º 9
0
static void
grl_tmdb_source_init (GrlTmdbSource *self)
{
  self->priv = grl_tmdb_source_get_instance_private (self);
  self->priv->supported_keys = g_hash_table_new (g_direct_hash, g_direct_equal);
  self->priv->slow_keys = g_hash_table_new (g_direct_hash, g_direct_equal);

  /* Fast keys */
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_TITLE));
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_THUMBNAIL));
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_TMDB_METADATA_KEY_BACKDROP));
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_TMDB_METADATA_KEY_POSTER));
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ORIGINAL_TITLE));
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_RATING));
  g_hash_table_add (self->priv->supported_keys,
                    GRLKEYID_TO_POINTER (GRL_TMDB_METADATA_KEY_TMDB_ID));

  /* Slow keys */
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_SITE));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_GENRE));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_STUDIO));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_DESCRIPTION));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_CERTIFICATE));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_REGION));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_TMDB_METADATA_KEY_IMDB_ID));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_KEYWORD));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_PERFORMER));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_PRODUCER));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_DIRECTOR));
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_AUTHOR));

  /* The publication date is both available as fast key in the movie details,
   * but also as more detailed information as regional release date. To avoid
   * confusion in clients that do a fast resolve first and merge slow data
   * later we hide the fast version.
   */
  g_hash_table_add (self->priv->slow_keys,
                    GRLKEYID_TO_POINTER (GRL_METADATA_KEY_PUBLICATION_DATE));

  self->priv->wc = grl_net_wc_new ();
  grl_net_wc_set_throttling (self->priv->wc, 1);

  self->priv->config_pending = FALSE;
  self->priv->pending_resolves = g_queue_new ();
}