Package: jack / 3.1.1+cvs20050801-31

26_t_artist_cleanup.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Code clean-up: test only _once_ whether it's a multi-artist (VA) CD
(regarding the artist name).

diff --git a/jack_tag.py b/jack_tag.py
index 825c828..6d2147c 100755
--- a/jack_tag.py
+++ b/jack_tag.py
@@ -77,7 +77,10 @@ def tag(freedb_rename):
             sys.stdout.write(".") ; sys.stdout.flush()
             mp3name = i[NAME] + ext
             wavname = i[NAME] + ".wav"
-            t_artist = track_names[i[NUM]][0]
+            if track_names[i[NUM]][0]:
+                t_artist = track_names[i[NUM]][0]
+            else:
+                t_artist = a_artist
             t_name = track_names[i[NUM]][1]
             t_comm = ""
             if not cf['_only_dae'] and cf['_set_id3tag']:
@@ -106,10 +109,7 @@ def tag(freedb_rename):
                         tag.setTitle(t_name)
                         tag.setTrackNum((i[NUM],len(jack_ripstuff.all_tracks_orig)))
                         tag.setTitle(t_name)
-                        if t_artist:
-                           tag.setArtist(t_artist)
-                        else:
-                            tag.setArtist(a_artist)
+                        tag.setArtist(t_artist)
                         if cf['_id3_genre'] != -1:
                             tag.setGenre("(%d)" % (cf['_id3_genre']))
                         if cf['_id3_year'] != -1:
@@ -134,10 +134,7 @@ def tag(freedb_rename):
                             tag.setTitle(t_name)
                         tag.setTrackNum((i[NUM],len(jack_ripstuff.all_tracks_orig)))
                         tag.setTitle(t_name)
-                        if t_artist:
-                            tag.setArtist(t_artist)
-                        else:
-                            tag.setArtist(a_artist)
+                        tag.setArtist(t_artist)
                         if cf['_id3_genre'] != -1:
                             tag.setGenre("(%d)" % (cf['_id3_genre']))
                         elif old_genre == None:
@@ -168,10 +165,7 @@ def tag(freedb_rename):
                             vc.comments['ALBUM'] = a_title.encode("utf-8")
                             vc.comments['TRACKNUMBER'] = `i[NUM]`
                             vc.comments['TITLE'] = t_name.encode("utf-8")
-                            if t_artist:
-                                vc.comments['ARTIST'] = t_artist.encode("utf-8")
-                            else:
-                                vc.comments['ARTIST'] = a_artist.encode("utf-8")
+                            vc.comments['ARTIST'] = t_artist.encode("utf-8")
                             if cf['_id3_genre'] != -1:
                                 vc.comments['GENRE'] = id3genres[cf['_id3_genre']]
                             if cf['_id3_year'] != -1:
@@ -189,10 +183,7 @@ def tag(freedb_rename):
                     oggi.add_tag('ALBUM', a_title.encode("utf-8"))
                     oggi.add_tag('TRACKNUMBER', `i[NUM]`)
                     oggi.add_tag('TITLE', t_name.encode("utf-8"))
-                    if t_artist:
-                        oggi.add_tag('ARTIST', t_artist.encode("utf-8"))
-                    else:
-                        oggi.add_tag('ARTIST', a_artist.encode("utf-8"))
+                    oggi.add_tag('ARTIST', t_artist.encode("utf-8"))
                     if cf['_id3_genre'] != -1:
                         oggi.add_tag('GENRE', id3genres[cf['_id3_genre']])
                     if cf['_id3_year'] != -1: