Permalink
Browse files

metadata: Add passive bindings of videos

  • Loading branch information...
1 parent ac8fbdb commit a955c2e7f17227710f4412404f0b3f5b2699aaf0 @andoma committed Oct 10, 2012
Showing with 19 additions and 12 deletions.
  1. +6 −7 src/metadata/browsemdb.c
  2. +1 −1 src/metadata/decoration.c
  3. +10 −3 src/metadata/metadata.c
  4. +2 −1 src/metadata/metadata.h
View
13 src/metadata/browsemdb.c
@@ -102,10 +102,10 @@ static void
add_item(bmdb_t *b, const char *url, const char *parent, int contenttype)
{
char fname[512];
- char folder[512];
+ char directory[512];
fa_url_get_last_component(fname, sizeof(fname), url);
- fa_url_get_last_component(folder, sizeof(folder), parent);
+ fa_url_get_last_component(directory, sizeof(directory), parent);
rstr_t *title = metadata_remove_postfix(fname);
@@ -118,14 +118,13 @@ add_item(bmdb_t *b, const char *url, const char *parent, int contenttype)
rstr_t *rurl = rstr_alloc(url);
- rstr_t *rfolder = rstr_alloc(folder);
+ rstr_t *rdir = rstr_alloc(directory);
metadata_bind_video_info(metadata,
rurl, title,
- NULL,
- 5000, options,
- item, rfolder,
- 0);
+ NULL, 0,
+ options, item,
+ rdir, 0, 1);
if(prop_set_parent(item, b->b_nodes))
prop_destroy(item);
View
2 src/metadata/decoration.c
@@ -173,7 +173,7 @@ analyze_video(deco_item_t *di)
di->di_ds->ds_imdb_id ?: db->db_imdb_id,
di->di_duration, di->di_options,
di->di_root, db->db_title,
- db->db_lonely_video_item);
+ db->db_lonely_video_item, 0);
rstr_release(fname);
}
View
13 src/metadata/metadata.c
@@ -674,9 +674,8 @@ struct metadata_lazy_video {
int mlv_duration;
unsigned char mlv_type;
unsigned char mlv_lonely : 1;
-
+ unsigned char mlv_passive : 1;
int mlv_dsid;
-
};
@@ -988,9 +987,16 @@ mlv_get_video_info0(void *db, metadata_lazy_video_t *mlv, int refresh)
} else if(msf->query_by_imdb_id != NULL && mlv->mlv_imdb_id != NULL) {
qtype = METADATA_QTYPE_IMDB;
q = rstr_get(mlv->mlv_imdb_id);
+
+ if(mlv->mlv_passive)
+ continue;
+
} else {
qtype = METADATA_QTYPE_FILENAME_OR_DIRECTORY;
q = NULL;
+
+ if(mlv->mlv_passive)
+ continue;
}
if(md && md->md_dsid == ms->ms_id && is_qtype_compat(qtype, md->md_qtype))
@@ -1718,7 +1724,7 @@ metadata_lazy_video_t *
metadata_bind_video_info(prop_t *prop, rstr_t *url, rstr_t *filename,
rstr_t *imdb_id, int duration,
prop_t *options, prop_t *root,
- rstr_t *folder, int lonely)
+ rstr_t *folder, int lonely, int passive)
{
metadata_lazy_video_t *mlv = mlp_alloc(&mlc_video);
@@ -1729,6 +1735,7 @@ metadata_bind_video_info(prop_t *prop, rstr_t *url, rstr_t *filename,
mlv->mlv_imdb_id = rstr_dup(imdb_id);
mlv->mlv_type = METADATA_TYPE_VIDEO;
mlv->mlv_lonely = lonely;
+ mlv->mlv_passive = passive;
mlv->mlv_m = prop_ref_inc(prop);
mlv->mlv_trig_title =
View
3 src/metadata/metadata.h
@@ -408,7 +408,8 @@ metadata_lazy_video_t *metadata_bind_video_info(struct prop *prop,
rstr_t *imdb_id, int duration,
struct prop *options,
struct prop *root,
- rstr_t *parent, int lonely);
+ rstr_t *parent, int lonely,
+ int passive);
void mlv_unbind(metadata_lazy_video_t *mlv);

0 comments on commit a955c2e

Please sign in to comment.