Project

General

Profile

Feature #508 ยป patch1.diff

Patch - Silo DS, 2011-05-12 14:57

View differences:

src/dvr/dvr.h
52 52
#define DVR_EPISODE_IN_TITLE	0x80
53 53
#define DVR_CLEAN_TITLE	        0x100
54 54
#define DVR_TAG_FILES           0x200
55
#define DVR_SUBTITLE_IN_TITLE	0x400
55 56

  
56 57
typedef enum {
57 58
  DVR_PRIO_IMPORTANT,
src/dvr/dvr_db.c
194 194
	       de->de_episode.ee_episode);
195 195
  }
196 196

  
197
/*  if(cfg->dvr_flags & DVR_SUBTITLE_IN_TITLE) { */
198

  
199
    if(de->de_episode.ee_subtitle)
200
      snprintf(output + strlen(output), outlen - strlen(output), 
201
	       ".%s",
202
	       de->de_episode.ee_subtitle);
203
/*  } */
204

  
197 205
  if(cfg->dvr_flags & DVR_CLEAN_TITLE) {
198 206
        for (i=0;i<strlen(output);i++) {
199 207
                if (
......
295 303
    de->de_episode.ee_episode = ee->ee_episode;
296 304
    de->de_episode.ee_part    = ee->ee_part;
297 305
    tvh_str_set(&de->de_episode.ee_onscreen, ee->ee_onscreen);
306
    tvh_str_set(&de->de_episode.ee_subtitle, ee->ee_subtitle);
298 307
  }
299 308

  
300 309
  de->de_content_type = content_type;
......
399 408
  free(de->de_desc);
400 409

  
401 410
  free(de->de_episode.ee_onscreen);
411
  free(de->de_episode.ee_subtitle);
402 412

  
403 413
  free(de);
404 414
}
......
514 524
  de->de_content_type = htsmsg_get_u32_or_default(c, "contenttype", 0);
515 525

  
516 526
  tvh_str_set(&de->de_episode.ee_onscreen, htsmsg_get_str(c, "episodename"));
527
  tvh_str_set(&de->de_episode.ee_subtitle, htsmsg_get_str(c, "subtitle"));
517 528

  
518 529
  dvr_entry_link(de);
519 530
}
......
590 601
    htsmsg_add_u32(m, "part", de->de_episode.ee_part);
591 602
  if(de->de_episode.ee_onscreen)
592 603
    htsmsg_add_str(m, "episodename", de->de_episode.ee_onscreen);
604
  if(de->de_episode.ee_subtitle)
605
    htsmsg_add_str(m, "subtitle", de->de_episode.ee_subtitle);
593 606

  
594 607
  if(de->de_content_type)
595 608
    htsmsg_add_u32(m, "contenttype", de->de_content_type);
......
840 853
      if(!htsmsg_get_u32(m, "episode-in-title", &u32) && u32)
841 854
        cfg->dvr_flags |= DVR_EPISODE_IN_TITLE;
842 855

  
856
      if(!htsmsg_get_u32(m, "subtitle-in-title", &u32) && u32)
857
        cfg->dvr_flags |= DVR_SUBTITLE_IN_TITLE;
858

  
843 859
      if(!htsmsg_get_u32(m, "tag-files", &u32) && !u32)
844 860
        cfg->dvr_flags &= ~DVR_TAG_FILES;
845 861
     
......
990 1006
  htsmsg_add_u32(m, "whitespace-in-title", !!(cfg->dvr_flags & DVR_WHITESPACE_IN_TITLE));
991 1007
  htsmsg_add_u32(m, "title-dir", !!(cfg->dvr_flags & DVR_DIR_PER_TITLE));
992 1008
  htsmsg_add_u32(m, "episode-in-title", !!(cfg->dvr_flags & DVR_EPISODE_IN_TITLE));
1009
  htsmsg_add_u32(m, "subtitle-in-title", !!(cfg->dvr_flags & DVR_SUBTITLE_IN_TITLE));
993 1010
  htsmsg_add_u32(m, "tag-files", !!(cfg->dvr_flags & DVR_TAG_FILES));
994 1011
  if(cfg->dvr_postproc != NULL)
995 1012
    htsmsg_add_str(m, "postproc", cfg->dvr_postproc);
src/epg.c
148 148
     */
149 149
    return 0;
150 150
  }
151

  
152
  if (desc[1] == '/' || desc[2] == '/' || desc[3] == '/') {
153
    char *tmp;
154
    tmp = strndup (desc, strchr (desc,'/')-desc);
155
    e->e_episode.ee_episode = atoi (tmp);
156
    e->e_episode.ee_onscreen = malloc (strlen (tmp+1));
157
    sprintf (e->e_episode.ee_onscreen, "E%d", e->e_episode.ee_episode);
158
    free (tmp);
159
  }
160

  
161
  int i,j=-1;
162
  for (i=0;i<strlen(desc);i++) {
163
    if (desc[i] == ':') {
164
      j=i;
165
      break;
166
    }
167
  } 
168

  
169
  if (j>0) {
170
   if (e->e_episode.ee_subtitle) {
171
     free (e->e_episode.ee_subtitle);
172
   }
173
   e->e_episode.ee_subtitle = strndup (desc,j);
174
  } 
175

  
151 176
  free(e->e_desc);
152
  e->e_desc = strdup(desc);
153
  return 1;
177
  e->e_desc = strdup(desc+j+1);
178
  
179
return 1;
154 180
}
155 181

  
156 182
/**
......
272 298
  free(e->e_title);
273 299
  free(e->e_desc);
274 300
  free(e->e_episode.ee_onscreen);
301
  free(e->e_episode.ee_subtitle);
275 302
  LIST_REMOVE(e, e_global_link);
276 303
  free(e);
277 304
}
......
589 616
  if((s = htsmsg_get_str(c, "epname")) != NULL)
590 617
    tvh_str_set(&e->e_episode.ee_onscreen, s);
591 618

  
619
  if((s = htsmsg_get_str(c, "subtitle")) != NULL)
620
    tvh_str_set(&e->e_episode.ee_subtitle, s);
621

  
592 622
  return 1;
593 623
}
594 624

  
......
701 731
      if(e->e_episode.ee_onscreen)
702 732
	htsmsg_add_str(m, "epname", e->e_episode.ee_onscreen);
703 733

  
734
      if(e->e_episode.ee_subtitle)
735
	htsmsg_add_str(m, "subtitle", e->e_episode.ee_subtitle);
736

  
704 737

  
705 738
      int r = htsmsg_binary_serialize(m, &msgdata, &msglen, 0x10000);
706 739
      htsmsg_destroy(m);
src/epg.h
31 31
  uint16_t ee_part;
32 32

  
33 33
  char *ee_onscreen;
34
  char *ee_subtitle;
34 35
} epg_episode_t;
35 36

  
36 37

  
src/webui/extjs.c
716 716
    if(e->e_episode.ee_onscreen != NULL)
717 717
      htsmsg_add_str(m, "episode", e->e_episode.ee_onscreen);
718 718

  
719
    if(e->e_episode.ee_subtitle != NULL)
720
      htsmsg_add_str(m, "subtitle", e->e_episode.ee_subtitle);
721

  
719 722
    if(e->e_ext_desc != NULL)
720 723
      htsmsg_add_str(m, "ext_desc", e->e_ext_desc);
721 724

  
......
901 904
    htsmsg_add_u32(r, "whitespaceInTitle", !!(cfg->dvr_flags & DVR_WHITESPACE_IN_TITLE));
902 905
    htsmsg_add_u32(r, "titleDirs", !!(cfg->dvr_flags & DVR_DIR_PER_TITLE));
903 906
    htsmsg_add_u32(r, "episodeInTitle", !!(cfg->dvr_flags & DVR_EPISODE_IN_TITLE));
907
    htsmsg_add_u32(r, "subtitleInTitle", !!(cfg->dvr_flags & DVR_SUBTITLE_IN_TITLE));
904 908
    htsmsg_add_u32(r, "cleanTitle", !!(cfg->dvr_flags & DVR_CLEAN_TITLE));
905 909
    htsmsg_add_u32(r, "tagFiles", !!(cfg->dvr_flags & DVR_TAG_FILES));
906 910

  
......
948 952
      flags |= DVR_DIR_PER_TITLE;
949 953
    if(http_arg_get(&hc->hc_req_args, "episodeInTitle") != NULL)
950 954
      flags |= DVR_EPISODE_IN_TITLE;
955
    if(http_arg_get(&hc->hc_req_args, "subtitleInTitle") != NULL)
956
      flags |= DVR_SUBTITLE_IN_TITLE;
951 957
    if(http_arg_get(&hc->hc_req_args, "tagFiles") != NULL)
952 958
      flags |= DVR_TAG_FILES;
953 959

  
......
1044 1050
    if(de->de_episode.ee_onscreen)
1045 1051
      htsmsg_add_str(m, "episode", de->de_episode.ee_onscreen);
1046 1052

  
1053
    if(de->de_episode.ee_subtitle)
1054
      htsmsg_add_str(m, "subtitle", de->de_episode.ee_subtitle);
1055

  
1047 1056
    htsmsg_add_u32(m, "id", de->de_id);
1048 1057
    htsmsg_add_u32(m, "start", de->de_start);
1049 1058
    htsmsg_add_u32(m, "end", de->de_stop);
src/webui/static/app/dvr.js
199 199
	    dataIndex: 'episode'
200 200
	},{
201 201
	    width: 100,
202
	    id:'subtitle',
203
	    header: "Subtitle",
204
	    dataIndex: 'subtitle'
205
	},{
206
	    width: 100,
202 207
	    id:'pri',
203 208
	    header: "Priority",
204 209
	    dataIndex: 'pri',
......
579 584
	    {name: 'channel'},
580 585
	    {name: 'title'},
581 586
	    {name: 'episode'},
587
	    {name: 'subtitle'},
582 588
	    {name: 'pri'},
583 589
	    {name: 'description'},
584 590
	    {name: 'chicon'},
......
667 673
	'channelDirs','channelInTitle',
668 674
	'dateInTitle','timeInTitle',
669 675
	'preExtraTime', 'postExtraTime', 'whitespaceInTitle', 
670
	'titleDirs', 'episodeInTitle', 'cleanTitle', 'tagFiles']);
676
	'titleDirs', 'episodeInTitle', 'subtitleInTitle', 'cleanTitle', 'tagFiles']);
671 677

  
672 678
    var confcombo = new Ext.form.ComboBox({
673 679
        store: tvheadend.configNames,
......
743 749
	    fieldLabel: 'Include episode in filename',
744 750
	    name: 'episodeInTitle'
745 751
	}), new Ext.form.Checkbox({
752
	    fieldLabel: 'Include subtitle in filename',
753
	    name: 'subtitleInTitle'
754
	}), new Ext.form.Checkbox({
746 755
	    fieldLabel: 'Replace whitespace in title with \'-\'',
747 756
	    name: 'whitespaceInTitle'
748 757
	}), new Ext.form.Checkbox({
src/webui/static/app/epg.js
17 17

  
18 18
    content += '<div class="x-epg-title">' + event.title + '</div>';
19 19
    content += '<div class="x-epg-desc">' + event.episode + '</div>';
20
    content += '<div class="x-epg-desc">' + event.subtitle + '</div>';
20 21
    content += '<div class="x-epg-desc">' + event.description + '</div>';
21 22

  
22 23
    content += '<div class="x-epg-meta">' + event.contentgrp + '</div>';
......
126 127
	    {name: 'channelid'},
127 128
	    {name: 'title'},
128 129
	    {name: 'episode'},
130
	    {name: 'subtitle'},
129 131
	    {name: 'description'},
130 132
	    {name: 'ext_desc'},
131 133
	    {name: 'ext_item'},
......
195 197
	    renderer: renderText
196 198
	},{
197 199
	    width: 100,
200
	    id:'subtitle',
201
	    header: "Subtitle",
202
	    dataIndex: 'subtitle',
203
	    renderer: renderText
204
	},{
205
	    width: 100,
198 206
	    id:'start',
199 207
	    header: "Start",
200 208
	    dataIndex: 'start',
    (1-1/1)