Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- better duplicate handling - better subtitle handling
  • Loading branch information
dero authored and perexg committed Mar 9, 2015
1 parent ce78f14 commit 2b22bc7
Show file tree
Hide file tree
Showing 9 changed files with 275 additions and 67 deletions.
22 changes: 18 additions & 4 deletions src/dvr/dvr.h
Expand Up @@ -163,6 +163,7 @@ typedef struct dvr_entry {
char *de_directory; /* Can be set for autorec entries, will override any
directory setting from the configuration */
lang_str_t *de_title; /* Title in UTF-8 (from EPG) */
lang_str_t *de_subtitle; /* Subtitle in UTF-8 (from EPG) */
lang_str_t *de_desc; /* Description in UTF-8 (from EPG) */
uint32_t de_content_type; /* Content type (from EPG) (only code) */

Expand Down Expand Up @@ -244,6 +245,16 @@ typedef struct dvr_entry {

#define DVR_CH_NAME(e) ((e)->de_channel == NULL ? (e)->de_channel_name : channel_get_name((e)->de_channel))

typedef enum {
DVR_AUTOREC_RECORD_ALL = 0,
DVR_AUTOREC_RECORD_DIFFERENT_EPISODE_NUMBER = 1,
DVR_AUTOREC_RECORD_DIFFERENT_SUBTITLE = 2,
DVR_AUTOREC_RECORD_DIFFERENT_DESCRIPTION = 3,
DVR_AUTOREC_RECORD_ONCE_PER_WEEK = 4,
DVR_AUTOREC_RECORD_ONCE_PER_DAY = 5
} dvr_autorec_dedup_t;


/**
* Autorec entry
*/
Expand Down Expand Up @@ -291,9 +302,12 @@ typedef struct dvr_autorec_entry {
int dae_minduration;
int dae_maxduration;
int dae_retention;

time_t dae_start_extra;
time_t dae_stop_extra;

int dae_record;

} dvr_autorec_entry_t;

TAILQ_HEAD(dvr_autorec_entry_queue, dvr_autorec_entry);
Expand Down Expand Up @@ -432,7 +446,7 @@ dvr_entry_t *
dvr_entry_create_htsp( const char *dvr_config_uuid,
channel_t *ch, time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
const char *title, const char *description,
const char *title, const char* subtitle, const char *description,
const char *lang, epg_genre_t *content_type,
const char *owner, const char *creator,
dvr_autorec_entry_t *dae,
Expand All @@ -441,7 +455,7 @@ dvr_entry_create_htsp( const char *dvr_config_uuid,

dvr_entry_t *
dvr_entry_update( dvr_entry_t *de,
const char* de_title, const char *de_desc, const char *lang,
const char* de_title, const char* de_subtitle, const char *de_desc, const char *lang,
time_t de_start, time_t de_stop,
time_t de_start_extra, time_t de_stop_extra,
dvr_prio_t pri, int retention );
Expand Down Expand Up @@ -506,7 +520,7 @@ dvr_entry_t *
dvr_entry_create_(const char *config_uuid, epg_broadcast_t *e,
channel_t *ch, time_t start, time_t stop,
time_t start_extra, time_t stop_extra,
const char *title, const char *description,
const char *title, const char* subtitle, const char *description,
const char *lang, epg_genre_t *content_type,
const char *owner, const char *creator,
dvr_autorec_entry_t *dae, dvr_timerec_entry_t *tae,
Expand Down
24 changes: 23 additions & 1 deletion src/dvr/dvr_autorec.c
@@ -1,6 +1,6 @@
/*
* tvheadend, Automatic recordings
* Copyright (C) 2010 Andreas Öman
* Copyright (C) 2010 Andreas �man
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -867,6 +867,20 @@ dvr_autorec_entry_class_content_type_list(void *o)
return m;
}

static htsmsg_t *
dvr_autorec_entry_class_dedup_list ( void *o )
{
static const struct strtab tab[] = {
{ "Record all", DVR_AUTOREC_RECORD_ALL },
{ "Record if different episode number", DVR_AUTOREC_RECORD_DIFFERENT_EPISODE_NUMBER },
{ "Record if different subtitle", DVR_AUTOREC_RECORD_DIFFERENT_SUBTITLE },
{ "Record if different description", DVR_AUTOREC_RECORD_DIFFERENT_DESCRIPTION },
{ "Record once per week", DVR_AUTOREC_RECORD_ONCE_PER_WEEK },
{ "Record once per day", DVR_AUTOREC_RECORD_ONCE_PER_DAY },
};
return strtab2htsmsg(tab);
}

const idclass_t dvr_autorec_entry_class = {
.ic_class = "dvrautorec",
.ic_caption = "DVR Auto-Record Entry",
Expand Down Expand Up @@ -999,6 +1013,14 @@ const idclass_t dvr_autorec_entry_class = {
.def.i = DVR_PRIO_NORMAL,
.off = offsetof(dvr_autorec_entry_t, dae_pri),
},
{
.type = PT_U32,
.id = "record",
.name = "Duplicate Handling",
.def.i = DVR_AUTOREC_RECORD_ALL,
.off = offsetof(dvr_autorec_entry_t, dae_record),
.list = dvr_autorec_entry_class_dedup_list,
},
{
.type = PT_INT,
.id = "retention",
Expand Down

0 comments on commit 2b22bc7

Please sign in to comment.