diff --git a/api/media.py b/api/media.py index 0131abd..e345737 100755 --- a/api/media.py +++ b/api/media.py @@ -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') diff --git a/scanner.py b/scanner.py index d2d3681..05cc0d2 100755 --- a/scanner.py +++ b/scanner.py @@ -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 ]: