Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better verbose logging

  • Loading branch information...
commit 1cdc6a1d034a692af352ee83343323b89db41917 1 parent 965fdd1
@dbrgn authored
Showing with 11 additions and 7 deletions.
  1. +11 −7 indexer.py
View
18 indexer.py
@@ -113,16 +113,17 @@ def save_track(self):
full_path = self.file_path.decode('utf-8')
- if self.verbose:
- print(self.file_path)
-
track = m.Track(full_path)
if self.no_metadata:
self.session.add(track)
- return True
+ if self.verbose:
+ print 'Added track without metadata: %s' % full_path
+ return
else:
if q(m.Track).filter_by(path=full_path).count():
- return True
+ if self.verbose:
+ print 'Skipped existing track: %s' % full_path
+ return
meta = self.get_metadata_reader()
@@ -136,11 +137,14 @@ def save_track(self):
track.artist = artist
self.session.add(track)
+ if self.verbose:
+ print 'Added track: %s' % full_path
+
self.count += 1
if self.count % 10 == 0:
self.session.commit()
-
- return True
+ if self.verbose:
+ print 'Writing to database...'
def get_metadata_reader(self):
if not self._meta or self._meta.origpath != self.file_path:
Please sign in to comment.
Something went wrong with that request. Please try again.