Browse the code

 

Differences between 212 and 213 on /.
Number of edited files: 4 (0 added, 0 deleted and 4 modified)
Revision 213

About 14 days and 20 hours ago.

* Fixed a bug: basic update (new or deleted files) at each startup was not working
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
290
290
        </child>
291
291
        <child>
292
292
          <object class="GtkBox" id="box8">
293
 
            <property name="width_request">180</property>
294
293
            <property name="visible">True</property>
295
294
            <property name="can_focus">False</property>
296
295
            <property name="halign">start</property>
297
296

                                        

 

Old New Code
150
150

                                        
151
151
            pb = win.get_object('progressbar')
152
152
            def pb_pulse():
153
 
                pb.pulse()
154
 
                return True
 
153
                if not force_scan:
 
154
                    pb.pulse()
 
155
                    return True
155
156
            timeout_add(50, pb_pulse)
156
157

                                        
157
158
            if force_scan:
159
160
                output = musicdb.scan(lbl, pb)
160
161
            else:
161
162
                # Do an update on an existing database (faster, at each startup)
162
 
                #output = musicdb.update_db([lbl, pb])
 
163
                output = musicdb.update_db([lbl, pb])
163
164
                output = False
164
165

                                        
165
166
            if output:
190
191
                for i in range(5):
191
192
                    sleep(0.2)
192
193
                    while gtk_events_pending():
193
 
                        gtk_main_iteration(False)
 
194
                        gtk_main_iteration()
194
195
            wait()
195
196

                                        
196
197
            # Show original GUI
197
198

                                        

 

Old New Code
52
52

                                        
53
53
        self.albumview.set_column_spacing(0)
54
54
        self.albumview.set_spacing(0)
55
 
        self.albumview.set_item_width(100)
 
55
        self.albumview.set_item_width(120)
 
56
        self.albumview.set_item_padding(10)
56
57
        self.albumview.set_property('activate-on-single-click', False)
57
58

                                        
58
59
        self.albumview.set_hexpand(True)
59
60

                                        

 

Old New Code
16
16
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
17

                                        
18
18
from gettext import gettext as _
19
 
from gi.repository.GObject import idle_add
 
19
from gi.repository.GObject import idle_add, timeout_add
20
20
from re import compile as re_compile
21
21
from os.path import join
22
22
from os import walk
76
76
                                songs_data[0])
77
77

                                        
78
78
        for sng in songs_to_del:
79
 
            idle_add(print, '[UPDATE] Added %d new songs.' % len(songs_to_add))
80
79
            sqlite.execute('delete from songs where filename=:val',
81
80
                           {'val': sng})
82
81

                                        
 
82
        if len(songs_to_del) > 0:
 
83
            idle_add(print, '[UPDATE] Deleted %d songs.' % len(songs_to_del))
 
84

                                    
83
85
        # The job is ended o/
84
86
        sqlite.close()
85
87

                                        
117
119
        ok_song = process_output[1][4]
118
120

                                        
119
121
        if wdg is not None:
 
122
            def pb_pulse():
 
123
                idle_add(wdg[1].pulse)
 
124
                return True
 
125
            timeout_add(50, pb_pulse)
 
126

                                    
120
127
            idle_add(wdg[0].set_text,
121
128
                     _('Metadata retrieved for %d songs. Updating database…' %
122
129
                     len(songs)))
123
130