epg: persist brand/season/episode images

This commit is contained in:
John Törnblom 2014-01-24 18:43:14 +01:00
parent f8f8efbebe
commit e068315a6b

View file

@ -504,6 +504,8 @@ htsmsg_t *epg_brand_serialize ( epg_brand_t *brand )
lang_str_serialize(brand->summary, m, "summary");
if (brand->season_count)
htsmsg_add_u32(m, "season-count", brand->season_count);
if (brand->image)
htsmsg_add_str(m, "image", brand->image);
return m;
}
@ -512,6 +514,7 @@ epg_brand_t *epg_brand_deserialize ( htsmsg_t *m, int create, int *save )
epg_object_t **skel = _epg_brand_skel();
epg_brand_t *eb;
uint32_t u32;
const char *str;
lang_str_t *ls;
lang_str_ele_t *e;
@ -531,6 +534,9 @@ epg_brand_t *epg_brand_deserialize ( htsmsg_t *m, int create, int *save )
if ( !htsmsg_get_u32(m, "season-count", &u32) )
*save |= epg_brand_set_season_count(eb, u32, NULL);
if ( (str = htsmsg_get_str(m, "image")) )
*save |= epg_brand_set_image(eb, str, NULL);
return eb;
}
@ -686,6 +692,8 @@ htsmsg_t *epg_season_serialize ( epg_season_t *season )
htsmsg_add_u32(m, "episode-count", season->episode_count);
if (season->brand)
htsmsg_add_str(m, "brand", season->brand->uri);
if (season->image)
htsmsg_add_str(m, "image", season->image);
return m;
}
@ -717,6 +725,9 @@ epg_season_t *epg_season_deserialize ( htsmsg_t *m, int create, int *save )
if ( (eb = epg_brand_find_by_uri(str, 0, NULL)) )
*save |= epg_season_set_brand(es, eb, NULL);
if ( (str = htsmsg_get_str(m, "image")) )
*save |= epg_season_set_image(es, str, NULL);
return es;
}
@ -1152,6 +1163,9 @@ htsmsg_t *epg_episode_serialize ( epg_episode_t *episode )
htsmsg_add_u32(m, "age_rating", episode->age_rating);
if (episode->first_aired)
htsmsg_add_s64(m, "first_aired", episode->first_aired);
if (episode->image)
htsmsg_add_str(m, "image", episode->image);
return m;
}
@ -1229,6 +1243,9 @@ epg_episode_t *epg_episode_deserialize ( htsmsg_t *m, int create, int *save )
if (!htsmsg_get_s64(m, "first_aired", &s64))
*save |= epg_episode_set_first_aired(ee, (time_t)s64, NULL);
if ( (str = htsmsg_get_str(m, "image")) )
*save |= epg_episode_set_image(ee, str, NULL);
return ee;
}