1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-11-15 06:32:16 +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) dst_mimetype = scanner.get_mime(dst_suffix)
do_transcoding = True do_transcoding = True
app.logger.debug('Serving file: ' + res.path)
duration = mutagen.File(res.path).info.length 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: if do_transcoding:
transcoder = config.get('transcoding', 'transcoder_{}_{}'.format(src_suffix, dst_suffix)) transcoder = config.get('transcoding', 'transcoder_{}_{}'.format(src_suffix, dst_suffix))
@ -96,14 +97,13 @@ def stream_media():
try: try:
if transcoder: if transcoder:
app.logger.warn('single line transcode: '+transcoder) app.logger.warn('transcoder: '+str(transcoder))
proc = subprocess.Popen(transcoder, stdout = subprocess.PIPE, shell=False) proc = subprocess.Popen(transcoder, stdout = subprocess.PIPE, shell=False)
else: else:
app.logger.warn('multi process transcode: ')
dec_proc = subprocess.Popen(decoder, stdout = subprocess.PIPE, shell=False) dec_proc = subprocess.Popen(decoder, stdout = subprocess.PIPE, shell=False)
proc = subprocess.Popen(encoder, stdin = dec_proc.stdout, 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: except:
return request.error_formatter(0, 'Error while running the transcoding process') return request.error_formatter(0, 'Error while running the transcoding process')

View File

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