int dvr_running;
uint32_t dvr_cleanup_threshold_free;
uint32_t dvr_cleanup_threshold_used;
+ int dvr_fetch_artwork;
+ char *dvr_fetch_artwork_options;
muxer_config_t dvr_muxcnf;
.name = N_("Miscellaneous Settings"),
.number = 7,
},
+ {
+ .name = N_("Artwork Settings"),
+ .number = 8,
+ .column = 1,
+ },
{}
},
.ic_properties = (const property_t[]){
.opts = PO_ADVANCED,
.group = 1,
},
+ {
+ .type = PT_BOOL,
+ .id = "fetch-artwork",
+ .name = N_("Fetch artwork for new recordings."),
+ .desc = N_("Fetch additional artwork from installed providers. "
+ "Tvheadend has a 'tmdb' provider for movies, which requires "
+ "you to specify your authorized 'tmdb key' in the options below."),
+ .off = offsetof(dvr_config_t, dvr_fetch_artwork),
+ .opts = PO_ADVANCED,
+ .group = 8,
+ },
+ {
+ .type = PT_STR,
+ .id = "fetch-artwork-options",
+ .name = N_("Additional command line options when fetching artwork for new recordings."),
+ .desc = N_("Some artwork providers require additional arguments such as "
+ "'--tmdb-key my_key_from_website'. These can be specified here."),
+ .off = offsetof(dvr_config_t, dvr_fetch_artwork_options),
+ .opts = PO_ADVANCED,
+ .group = 8,
+ },
{
.type = PT_STR,
.id = "comment",
[DVR_PRIO_NOTSET] = 300, /* DVR_PRIO_NORMAL */
};
+/// Spawn a fetch of artwork for the entry.
+static void
+dvr_spawn_fetch_artwork(dvr_entry_t *de)
+{
+ const dvr_config_t *cfg;
+ /* Don't want to use _SC_ARG_MAX since it will be a large number */
+ char buf[1024];
+ char ubuf[UUID_HEX_SIZE];
+
+ /* Entry already have artwork? So nothing to do */
+ if (de->de_image && *de->de_image &&
+ de->de_fanart_image && *de->de_fanart_image)
+ return;
+
+ if (!de->de_config)
+ return;
+
+ cfg = de->de_config;
+ if (!cfg->dvr_fetch_artwork)
+ return;
+
+ snprintf(buf, sizeof buf, "tvhmeta --uuid %s %s",
+ idnode_uuid_as_str(&de->de_id, ubuf),
+ cfg->dvr_fetch_artwork_options);
+ dvr_spawn_cmd(de, buf, NULL, 1);
+}
+
/**
*
*/
if (de->de_config->dvr_preproc)
dvr_spawn_cmd(de, de->de_config->dvr_preproc, NULL, 1);
+ if (de->de_config->dvr_fetch_artwork)
+ dvr_spawn_fetch_artwork(de);
return 0;
}