Updating branch refs/heads/master to 362d13df8edb37d3470617f7d6413bf3d0555012 (commit) from 41fd44138dd5d966b924a466fe29bbf4d7965cb3 (commit)
commit 362d13df8edb37d3470617f7d6413bf3d0555012 Author: Nick Schermer <n...@xfce.org> Date: Wed Dec 12 22:09:28 2012 +0100 Always check in the title for a year. plugins/cover-thumbnailer/cover-thumbnailer.c | 42 ++++++++++++------------- 1 files changed, 20 insertions(+), 22 deletions(-) diff --git a/plugins/cover-thumbnailer/cover-thumbnailer.c b/plugins/cover-thumbnailer/cover-thumbnailer.c index 34302e9..14a70ff 100644 --- a/plugins/cover-thumbnailer/cover-thumbnailer.c +++ b/plugins/cover-thumbnailer/cover-thumbnailer.c @@ -533,33 +533,31 @@ cover_thumbnailer_get_title (CoverThumbnailer *cover, && start_pos > 0) basename[start_pos] = '\0'; g_match_info_free (match_info); + } - if (!is_series) + /* for non-series, look for a year in the title */ + if (!is_series + && g_regex_match (cover->year_regex, basename, 0, &match_info)) + { + /* store year and remove the suffix from the title */ + if (g_match_info_fetch_pos (match_info, 0, &start_pos, &end_pos) + && start_pos >= 0 + && end_pos > start_pos) { - /* for non-series, look for a year in the title */ - if (g_regex_match (cover->year_regex, basename, 0, &match_info)) + year = g_strndup (basename + start_pos, end_pos - start_pos); + + if (start_pos == 0) { - /* store year and remove the suffix from the title */ - if (g_match_info_fetch_pos (match_info, 0, &start_pos, &end_pos) - && start_pos >= 0 - && end_pos > start_pos) - { - year = g_strndup (basename + start_pos, end_pos - start_pos); - - if (start_pos == 0) - { - temp = g_strdup (basename + end_pos); - g_free (basename); - basename = temp; - } - else - { - basename[start_pos] = '\0'; - } - } - g_match_info_free (match_info); + temp = g_strdup (basename + end_pos); + g_free (basename); + basename = temp; + } + else + { + basename[start_pos] = '\0'; } } + g_match_info_free (match_info); } /* append the possible title part of the filename */ _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits