Package: jack / 3.1.1+cvs20050801-31

25_ignore_empty_freedb_info.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Print a warning but not an error when the FreeDB file has missing track
information for a track which is not about to be ripped/tagged.
Debian #292612.

diff -urN a/jack jack-3.1.1+cvs20050801/jack
--- a/jack	2006-02-05 15:18:38.000000000 +0000
+++ jack-3.1.1+cvs20050801/jack	2006-02-05 15:19:32.000000000 +0000
@@ -149,12 +149,12 @@
     if not os.path.exists(cf['_freedb_form_file'] + ".bak"):
         cf['_query_on_start'] = 1
 if cf['_query_on_start']:
-    freedb_rename = jack_prepare.query_on_start()
+    freedb_rename = jack_prepare.query_on_start(todo)
 
 ### (10) update freedb dbfile
 if cf['_update_freedb']:
     if not jack_tag.track_names:
-        err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, cf['_freedb_form_file'], verb = 1, dirs = 0)
+        err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, todo, cf['_freedb_form_file'], verb = 1, dirs = 0)
     jack_freedb.freedb_template(jack_ripstuff.all_tracks, jack_tag.track_names, revision + 1)
     jack_utils.ex_edit(cf['_freedb_form_file'])
     info("now submit your changes if you like, using the option --submit (via http POST). Don't forget to activate your changes locally with -R")
@@ -251,7 +251,7 @@
         jack_display.exit()
 
 if cf['_query_when_ready'] or cf['_read_freedb_file'] or cf['_query_on_start']:
-    err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, cf['_freedb_form_file'], verb = 1, dirs = 1)
+    err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, todo, cf['_freedb_form_file'], verb = 1, dirs = 1)
     if err:
         error("could not read freedb file")
 
diff -urN a/jack_freedb.py jack-3.1.1+cvs20050801/jack_freedb.py
--- a/jack_freedb.py	2006-02-05 15:18:38.000000000 +0000
+++ jack-3.1.1+cvs20050801/jack_freedb.py	2006-02-05 15:21:03.000000000 +0000
@@ -53,14 +53,14 @@
     },
 }
 
-def interpret_db_file(all_tracks, freedb_form_file, verb, dirs = 0, warn = None):
+def interpret_db_file(all_tracks, todo, freedb_form_file, verb, dirs = 0, warn = None):
     "read freedb file and rename dir(s)"
     global names_available, dir_created
     freedb_rename = 0
     if warn == None:
-        err, track_names, locale_names, cd_id, revision = freedb_names(freedb_id(all_tracks), all_tracks, freedb_form_file, verb = verb)
+        err, track_names, locale_names, cd_id, revision = freedb_names(freedb_id(all_tracks), all_tracks, todo, freedb_form_file, verb = verb)
     else:
-        err, track_names, locale_names, cd_id, revision = freedb_names(freedb_id(all_tracks), all_tracks, freedb_form_file, verb = verb, warn = warn)
+        err, track_names, locale_names, cd_id, revision = freedb_names(freedb_id(all_tracks), all_tracks, todo, freedb_form_file, verb = verb, warn = warn)
     if (not err) and dirs:
         freedb_rename = 1
 
@@ -319,7 +319,7 @@
     f.close()
     return err
 
-def freedb_names(cd_id, tracks, name, verb = 0, warn = 1):
+def freedb_names(cd_id, tracks, todo, name, verb = 0, warn = 1):
     "returns err, [(artist, albumname), (track_01-artist, track_01-name), ...], cd_id, revision"
     err = 0
     tracks_on_cd = tracks[-1][NUM]
@@ -355,7 +355,8 @@
  
     for i in tracks:    # check that info is there for all tracks
         if not freedb.has_key("TTITLE%i" % (i[NUM] - 1)):   # -1 because freedb starts at 0
-            err = 1
+            if i[NUM] in [x[NUM] for x in todo]:
+                err = 1
             if verb:
                 warning("no freedb info for track %02i (\"TTITLE%i\")" % (i[NUM], i[NUM] - 1))
             freedb["TTITLE%i" % (i[NUM] - 1)] = "[not set]"
diff -urN a/jack_prepare.py jack-3.1.1+cvs20050801/jack_prepare.py
--- a/jack_prepare.py	2006-02-05 15:18:38.000000000 +0000
+++ jack-3.1.1+cvs20050801/jack_prepare.py	2006-02-05 15:25:16.000000000 +0000
@@ -107,7 +107,7 @@
                         unique_dirs.append(jack_dirs[i])
                 for i in unique_dirs:
                     jack_ripstuff.all_tracks, dummy, track1_offset = jack_functions.cdrdao_gettoc(os.path.join(i, cf['_toc_file']))
-                    err, jack_tag.track_names, jack_tag.locale_names, cd_id, revision = freedb_names(jack_freedb.freedb_id(jack_ripstuff.all_tracks), jack_ripstuff.all_tracks,  os.path.join(i, cf['_freedb_form_file']), verb = 0, warn = 0)
+                    err, jack_tag.track_names, jack_tag.locale_names, cd_id, revision = freedb_names(jack_freedb.freedb_id(jack_ripstuff.all_tracks), jack_ripstuff.all_tracks, jack_ripstuff.all_tracks, os.path.join(i, cf['_freedb_form_file']), verb = 0, warn = 0)
                     if err or cf['_force']:# this means freedb data is not there yet
                         info("matching dir found: %d" % i)
                         pid = os.fork()
@@ -466,7 +466,7 @@
     if not is_submittable:
         error("can't submit in current state, please fix jack.freedb")
 
-    err, jack_tag.track_names, jack_tag.locale_names, cd_id, revision = jack_freedb.freedb_names(jack_freedb.freedb_id(jack_ripstuff.all_tracks), jack_ripstuff.all_tracks, cf['_freedb_form_file'], verb = 1)
+    err, jack_tag.track_names, jack_tag.locale_names, cd_id, revision = jack_freedb.freedb_names(jack_freedb.freedb_id(jack_ripstuff.all_tracks), jack_ripstuff.all_tracks, jack_ripstuff.all_tracks, cf['_freedb_form_file'], verb = 1)
     if err:
         error("invalid freedb file")
     else:
@@ -477,7 +477,7 @@
 
     ### (9) do query on start
 
-def query_on_start():
+def query_on_start(todo):
     info("querying...")
     if jack_freedb.freedb_query(jack_freedb.freedb_id(jack_ripstuff.all_tracks), jack_ripstuff.all_tracks, cf['_freedb_form_file']):
         if cf['_cont_failed_query']:
@@ -519,11 +519,11 @@
                         freedb_submit()
 
     if cf['_query_on_start']:
-        err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, cf['_freedb_form_file'], verb = cf['_query_on_start'], dirs = 1)
+        err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, todo, cf['_freedb_form_file'], verb = cf['_query_on_start'], dirs = 1)
         if err:
             error("query on start failed to give a good freedb file, aborting.")
     else:
-        err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, cf['_freedb_form_file'], verb = cf['_query_on_start'], warn = cf['_query_on_start'])
+        err, jack_tag.track_names, jack_tag.locale_names, freedb_rename, revision = jack_freedb.interpret_db_file(jack_ripstuff.all_tracks, todo, cf['_freedb_form_file'], verb = cf['_query_on_start'], warn = cf['_query_on_start'])
     return freedb_rename
 
 def undo_rename(status, todo):