Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: Fix the autorec minduration/maxduration
  • Loading branch information
perexg committed Sep 13, 2014
1 parent c6f0242 commit 242496e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/dvr/dvr.h
Expand Up @@ -388,7 +388,7 @@ void dvr_entry_cancel_delete(dvr_entry_t *de);

htsmsg_t *dvr_entry_class_pri_list(void *o);
htsmsg_t *dvr_entry_class_config_name_list(void *o);
htsmsg_t *dvr_entry_class_duration_list(void *o, const char *not_set, int max);
htsmsg_t *dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step);

/**
* Query interface
Expand Down
4 changes: 2 additions & 2 deletions src/dvr/dvr_autorec.c
Expand Up @@ -476,13 +476,13 @@ dvr_autorec_entry_class_time_list(void *o)
static htsmsg_t *
dvr_autorec_entry_class_minduration_list(void *o)
{
return dvr_entry_class_duration_list(o, "Any", 24*60);
return dvr_entry_class_duration_list(o, "Any", 24*60, 60);
}

static htsmsg_t *
dvr_autorec_entry_class_maxduration_list(void *o)
{
return dvr_entry_class_duration_list(o, "Any", 24*60);
return dvr_entry_class_duration_list(o, "Any", 24*60, 60);
}

static int
Expand Down
8 changes: 4 additions & 4 deletions src/dvr/dvr_db.c
Expand Up @@ -1585,7 +1585,7 @@ dvr_entry_class_channel_icon_url_get(void *o)
}

htsmsg_t *
dvr_entry_class_duration_list(void *o, const char *not_set, int max)
dvr_entry_class_duration_list(void *o, const char *not_set, int max, int step)
{
int i;
htsmsg_t *e, *l = htsmsg_create_list();
Expand All @@ -1597,7 +1597,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max)
for (i = 1; i <= 120; i++) {
snprintf(buf, sizeof(buf), "%d min%s", i, i > 1 ? "s" : "");
e = htsmsg_create_map();
htsmsg_add_u32(e, "key", i);
htsmsg_add_u32(e, "key", i * step);
htsmsg_add_str(e, "val", buf);
htsmsg_add_msg(l, NULL, e);
}
Expand All @@ -1607,7 +1607,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max)
else
snprintf(buf, sizeof(buf), "%d hrs %d min%s", i / 60, i % 60, (i % 60) > 0 ? "s" : "");
e = htsmsg_create_map();
htsmsg_add_u32(e, "key", i);
htsmsg_add_u32(e, "key", i * step);
htsmsg_add_str(e, "val", buf);
htsmsg_add_msg(l, NULL, e);
}
Expand All @@ -1617,7 +1617,7 @@ dvr_entry_class_duration_list(void *o, const char *not_set, int max)
static htsmsg_t *
dvr_entry_class_extra_list(void *o)
{
return dvr_entry_class_duration_list(o, "Not set (use channel or DVR config)", 4*60);
return dvr_entry_class_duration_list(o, "Not set (use channel or DVR config)", 4*60, 1);
}

static htsmsg_t *
Expand Down

0 comments on commit 242496e

Please sign in to comment.