Project

General

Profile

Feature #158 » whitespace-in-title.patch

Complete patch. - Fredrik Tuomas -, 2010-03-10 21:59

View differences:

src/dvr/dvr.h (working copy)
34 34
extern int dvr_extra_time_post;
35 35
extern struct dvr_entry_list dvrentries;
36 36

  
37
#define DVR_DIR_PER_DAY      0x1
38
#define DVR_DIR_PER_CHANNEL  0x2
39
#define DVR_CHANNEL_IN_TITLE 0x4
40
#define DVR_DATE_IN_TITLE    0x8
41
#define DVR_TIME_IN_TITLE    0x10
37
#define DVR_DIR_PER_DAY		0x1
38
#define DVR_DIR_PER_CHANNEL	0x2
39
#define DVR_CHANNEL_IN_TITLE	0x4
40
#define DVR_DATE_IN_TITLE	0x8
41
#define DVR_TIME_IN_TITLE	0x10
42
#define DVR_WHITESPACE_IN_TITLE	0x20
42 43

  
43 44
LIST_HEAD(dvr_rec_stream_list, dvr_rec_stream);
44 45

  
src/dvr/dvr_db.c (working copy)
557 557

  
558 558
    if(!htsmsg_get_u32(m, "time-in-title", &u32) && u32)
559 559
      dvr_flags |= DVR_TIME_IN_TITLE;
560
    
560
 
561
    if(!htsmsg_get_u32(m, "whitespace-in-title", &u32) && u32)
562
      dvr_flags |= DVR_WHITESPACE_IN_TITLE;
563
   
561 564
    tvh_str_set(&dvr_postproc, htsmsg_get_str(m, "postproc"));
562 565

  
563 566
    htsmsg_destroy(m);
......
608 611
  htsmsg_add_u32(m, "channel-in-title", !!(dvr_flags & DVR_CHANNEL_IN_TITLE));
609 612
  htsmsg_add_u32(m, "date-in-title",    !!(dvr_flags & DVR_DATE_IN_TITLE));
610 613
  htsmsg_add_u32(m, "time-in-title",    !!(dvr_flags & DVR_TIME_IN_TITLE));
614
  htsmsg_add_u32(m, "whitespace-in-title",    !!(dvr_flags & DVR_WHITESPACE_IN_TITLE));
611 615
  if(dvr_postproc != NULL)
612 616
    htsmsg_add_str(m, "postproc", dvr_postproc);
613 617

  
src/dvr/dvr_rec.c (working copy)
145 145
cleanupfilename(char *s)
146 146
{
147 147
  int i, len = strlen(s);
148
  for(i = 0; i < len; i++) 
148
  for(i = 0; i < len; i++){ 
149 149
    if(s[i] == '/' || s[i] == ':' || s[i] == '\\' || s[i] == '<' ||
150 150
       s[i] == '>' || s[i] == '|' || s[i] == '*' || s[i] == '?')
151 151
      s[i] = '-';
152

  
153
    if((dvr_flags & DVR_WHITESPACE_IN_TITLE) && s[i] == ' ')
154
      s[i] = '-';	
155
  }
152 156
}
153 157

  
154 158
/**
src/webui/static/app/dvr.js (working copy)
456 456
    }, ['storage','postproc','retention','dayDirs',
457 457
	'channelDirs','channelInTitle',
458 458
	'dateInTitle','timeInTitle',
459
	'preExtraTime', 'postExtraTime']);
459
	'preExtraTime', 'postExtraTime', 'whitespaceInTitle']);
460 460

  
461 461
    var confpanel = new Ext.FormPanel({
462 462
	title:'Digital Video Recorder',
......
503 503
	}), new Ext.form.Checkbox({
504 504
	    fieldLabel: 'Include time in title',
505 505
	    name: 'timeInTitle'
506
	}), new Ext.form.Checkbox({
507
	    fieldLabel: 'Replace whitespace in title with \'-\'',
508
	    name: 'whitespaceInTitle'
506 509
	}), {
507 510
	    width: 300,
508 511
	    fieldLabel: 'Post-processor command',
src/webui/extjs.c (working copy)
807 807
    htsmsg_add_u32(r, "channelInTitle", !!(dvr_flags & DVR_CHANNEL_IN_TITLE));
808 808
    htsmsg_add_u32(r, "dateInTitle",    !!(dvr_flags & DVR_DATE_IN_TITLE));
809 809
    htsmsg_add_u32(r, "timeInTitle",    !!(dvr_flags & DVR_TIME_IN_TITLE));
810
    htsmsg_add_u32(r, "whitespaceInTitle",    !!(dvr_flags & DVR_WHITESPACE_IN_TITLE));
810 811

  
811 812
    out = json_single_record(r, "dvrSettings");
812 813

  
......
837 838
      flags |= DVR_DATE_IN_TITLE;
838 839
    if(http_arg_get(&hc->hc_req_args, "timeInTitle") != NULL)
839 840
      flags |= DVR_TIME_IN_TITLE;
841
    if(http_arg_get(&hc->hc_req_args, "whitespaceInTitle") != NULL)
842
      flags |= DVR_WHITESPACE_IN_TITLE;
840 843

  
841 844
    dvr_flags_set(flags);
842 845

  
(3-3/3)