Skip to content

Commit

Permalink
fix meta data serch for CMCT style filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
RuralHunter committed Mar 26, 2018
1 parent 24a3bf9 commit e91ed09
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/metadata/metadata_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,25 @@ metadata_filename_to_title(const char *filename, int *yearp, rstr_t **titlep)
{
int year = 0;

char *s = mystrdupa(filename);
//skip the chars between a starting '[' and ']'.
char* start=NULL;
if(filename[0]=='[') {
start = strchr(filename,']');
if(start != NULL) {
start++;
if(start[0]=='.')
start++;
}
if(start>=filename+strlen(filename)) //don't skip if the '[]' includes the whole filename
start=NULL;
}

char *s ;

if(start==NULL)
s = mystrdupa(filename);
else
s = mystrdupa(start);

url_deescape(s);

Expand Down

0 comments on commit e91ed09

Please sign in to comment.