1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-14 22:22:18 +00:00

some edits to debug messages

This commit is contained in:
Emory P 2013-11-05 11:47:08 -05:00
parent 0dd8626069
commit 8f7309b0bf
2 changed files with 5 additions and 4 deletions

View File

@ -61,8 +61,9 @@ def stream_media():
dst_mimetype = scanner.get_mime(dst_suffix)
do_transcoding = True
app.logger.debug('Serving file: ' + res.path)
duration = mutagen.File(res.path).info.length
app.logger.debug('Duration of file: ' + str(duration))
app.logger.debug('\tDuration of file: ' + str(duration))
if do_transcoding:
transcoder = config.get('transcoding', 'transcoder_{}_{}'.format(src_suffix, dst_suffix))
@ -96,14 +97,13 @@ def stream_media():
try:
if transcoder:
app.logger.warn('single line transcode: '+transcoder)
app.logger.warn('transcoder: '+str(transcoder))
proc = subprocess.Popen(transcoder, stdout = subprocess.PIPE, shell=False)
else:
app.logger.warn('multi process transcode: ')
dec_proc = subprocess.Popen(decoder, stdout = subprocess.PIPE, shell=False)
proc = subprocess.Popen(encoder, stdin = dec_proc.stdout, stdout = subprocess.PIPE, shell=False)
response = Response(transcode(proc.stdout.readline), 206, {'Content-Type': dst_mimetype, 'X-Content-Duration': str(duration)})
response = Response(transcode(proc.stdout.readline), 200, {'Content-Type': dst_mimetype, 'X-Content-Duration': str(duration)})
except:
return request.error_formatter(0, 'Error while running the transcoding process')

View File

@ -63,6 +63,7 @@ class Scanner:
def prune(self, folder):
for k, track in self.__tracks.iteritems():
if track.root_folder.id == folder.id and not self.__is_valid_path(k):
app.debug('Removed invalid path: ' + k)
self.__remove_track(track)
for album in [ album for artist in self.__artists for album in artist.albums if len(album.tracks) == 0 ]: