diff options
Diffstat (limited to 'debian/patches/85_dir_template_yg.patch')
-rw-r--r-- | debian/patches/85_dir_template_yg.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/patches/85_dir_template_yg.patch b/debian/patches/85_dir_template_yg.patch new file mode 100644 index 0000000..5e17fb3 --- /dev/null +++ b/debian/patches/85_dir_template_yg.patch @@ -0,0 +1,54 @@ +Make %y and %g actually work dir_template (when the user doesn't explicitly +specify it with -G and -Y). First we need to set it when doing the FreeDB +lookup, and secondly we need to use the right variable for the replacement. +_id3_genre_txt is not set anywhere at all. Debian #351574 + +Depends on 76_mkdirname_cleanup.patch and 84_dyear_dgenre.patch + +--- orig/jack_freedb.py 2006-03-02 18:37:52.000000000 +0000 ++++ jack-3.1.1+cvs20050801/jack_freedb.py 2006-03-02 18:37:56.000000000 +0000 +@@ -525,6 +525,10 @@ + if freedb.has_key('DYEAR'): + try: + year = int(freedb['DYEAR']) ++ if cf['_id3_year'] <= 0: ++ cf['_id3_year'] = year ++ elif cf['_id3_year'] != year: ++ warning("Specified and FreeDB year differ (%d vs %d)" % (cf['_id3_year'], year)) + except ValueError: + warning("DYEAR has to be an integer but it's the string '%s'" % freedb['DYEAR']) + else: +@@ -537,6 +541,11 @@ + except ValueError: + if freedb['DGENRE'].upper() in [x.upper() for x in id3genres]: + genre = [x.upper() for x in id3genres].index(freedb['DGENRE'].upper()) ++ if cf['_id3_genre'] <= 0: ++ cf['_id3_genre'] = genre ++ elif cf['_id3_genre'] != genre: ++ warning("Specified and FreeDB genre differ (%s vs %s)" % ++ (id3genres[cf['_id3_genre']], id3genres[genre])) + else: + warning("DGENRE should be a string, not an integer.") + if freedb.has_key('EXTD') and not freedb.has_key('DYEAR'): +diff -urN orig/jack_utils.py jack-3.1.1+cvs20050801/jack_utils.py +--- orig/jack_utils.py 2006-03-02 18:37:52.000000000 +0000 ++++ jack-3.1.1+cvs20050801/jack_utils.py 2006-03-02 18:38:15.000000000 +0000 +@@ -168,13 +168,14 @@ + + def mkdirname(names, template): + "generate mkdir-able directory name(s)" ++ year = genretxt = None + if cf['_id3_year'] > 0: + year = `cf['_id3_year']` +- else: +- year = None ++ if cf['_id3_genre'] != -1: ++ genretxt = id3genres[cf['_id3_genre']] + replacelist = {"a": names[0][0].encode(cf['_charset'], "replace"), + "l": names[0][1].encode(cf['_charset'], "replace"), +- "y": year, "g": cf['_id3_genre_txt']} ++ "y": year, "g": genretxt} + # Process substitution patterns from dir_template + subst = template.split(os.path.sep) + dirs = [] + |