diff --git a/VERSION b/VERSION index 36275213..fb068551 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,4 @@ +5.2.2 - [artwork] Fixed wrong interpretation of relative path arguments 5.2.1 - [artwork] Fixed a bug that make the --album or --artwork option crash 5.2.0 - SEE CHANGELOG 5.1.1 - Some CSS-Updates to increase font size on 4k screens diff --git a/mod/artwork.py b/mod/artwork.py index d417138f..c9c5e829 100644 --- a/mod/artwork.py +++ b/mod/artwork.py @@ -103,6 +103,8 @@ def UpdateAlbum(self, albumpath, artworkpath=None): This method does partial update and can be used to force a specific artwork. If *artworkpath* is given, that artwork will be copied to the cache instead of extraction one from the metadata. + This method expects absolute paths or paths relative to the music root directory. + Args: albumpath (str): Path to an album. This can be absolute or relative to the music directory. artworkpath (str / NoneType): Absolute path to the artwork that shall be used if given. @@ -136,6 +138,18 @@ def UpdateAlbum(self, albumpath, artworkpath=None): def MDBM_Main(self, args): + # Make user paths absolute and check if they exist + if args.artwork: + args.artwork = os.path.abspath(args.artwork) + if not os.path.exists(args.artwork): + print("\033[1;31mERROR: Artwork path "+args.artwork+" does not exist!\033[0m") + return 1 + + if args.album: + args.album = os.path.abspath(args.album) + if not os.path.exists(args.album): + print("\033[1;31mERROR: Album path "+args.album+" does not exist!\033[0m") + return 1 # Update Cache and Manifest if args.update: