libPlaylists: dict[str, LibraryPlaylist] = self._createLibraryPlaylists(convertParams.playlistDir)
if len(libPlaylists) == 0:
- self._log("No playlist found.")
+ self._log("Error: No playlist found.")
return
# Existing files in target directory to be removed if not found in playlists.
if not os.path.isfile(trackFilePath):
self._log("Error: '" + trackFilePath + "' in playlist '"
+ playlist.name + "' is not a file.")
- stats.errors += 1
- continue
+ return
# Default task type: copy.
taskType: str = "copy"
taskType = "convert"
# Do nothing if extension not found in profile.
elif not convertProfile.isCopyExtension(targetExt):
- self._log("Error: Unsupported track file '"
+ self._log("Warning: Unsupported track file '"
+ trackFilePath + "' in playlist '"
+ playlist.name + "' for profile '"
+ convertProfile.name + "'.")
- stats.errors += 1
continue
targetFileName: str = targetName
if not os.path.isfile(targetFilePath):
self._log("Error: Existing target element '"
+ targetFilePath + "' is not a valid file.")
- stats.errors += 1
+ return
elif self.isFileChanged(trackFilePath, targetFilePath):
processedFiles.add(targetFile)
stats.tasks += 1
if element is None:
continue
- urlDecodedString: str = urllib.parse.unquote(str(element.text))
- playlist.add(os.path.dirname(urlDecodedString),
- os.path.basename(urlDecodedString))
+ decodedString: str = urllib.parse.unquote(str(element.text))
+
+ if decodedString.startswith("file://"):
+ decodedString = decodedString[7:]
+
+ playlist.add(os.path.dirname(decodedString),
+ os.path.basename(decodedString))
# Create or update playlist file from a directory.
def _updatePlaylistFile(self, playlist: list[str], playlistPath: str) -> None:
self._runLock.acquire()
if self._running:
- self._log("Error: This conveter is already running.")
+ self._log("Error: This converter is already running.")
else:
self._running = True
self._stopSignal = False