Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Custom playlist icon location
#1
I am uploading a bunch of custom playlists to my Moode box. The default two playlists have an `EXTIMG` tag for a playlist image. I see that those images are stored in a read-only (to me) folder:

Code:
@moode1:~ $ ls -l /var/local/www/imagesw/
total 200
drwxr-xr-x 2 root root   4096 Jan  8 14:27 playlist-covers
drwxr-xr-x 3 root root  16384 Jan  8 14:27 radio-logos
drwxr-xr-x 2 root root 180224 Jan 20 21:38 thmcache```
Is there a better place I can upload these images, or should I just sudo playlist-covers to writable? How would I reference this path in the EXTIMG tag?
Reply
#2
Go to the Playlist view in the library, each Playlist square has a three dot menu that appears when you mouse over, open that and choose Edit playlist. There you have the option to add a custom cover.
----------------
Robert
Reply
#3
(01-23-2025, 02:41 AM)taynaron Wrote: I am uploading a bunch of custom playlists to my Moode box. The default two playlists have an `EXTIMG` tag for a playlist image. I see that those images are stored in a read-only (to me) folder:

Code:
@moode1:~ $ ls -l /var/local/www/imagesw/
total 200
drwxr-xr-x 2 root root   4096 Jan  8 14:27 playlist-covers
drwxr-xr-x 3 root root  16384 Jan  8 14:27 radio-logos
drwxr-xr-x 2 root root 180224 Jan 20 21:38 thmcache```
Is there a better place I can upload these images, or should I just sudo playlist-covers to writable? How would I reference this path in the EXTIMG tag?


For #EXTIMG:local
- the value 'local' refers to the dir /var/local/www/imagesw/playlist-covers/
- the filename is expected to be same as the playlist name in /var/lib/mpd/playlists/

Example:
Code:
pi@moode9:~ $ ls -1 /var/lib/mpd/playlists/
'Default Playlist.m3u'
Favorites.m3u
'FluxFM Stations.m3u'

pi@moode9:~ $ ls -1 /var/local/www/imagesw/playlist-covers/
'Default Playlist.jpg'
Favorites.jpg
'FluxFM Stations.jpg'

I haven't looked at the code but IIRC 'local' can be replaced by a URL to a remote image or it can be replaced by a path. I think the path has to be absolute for example /home/pi/playlist-covers/Default Playlist.jpg
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#4
Thanks! I have attached images to my playlists as you can see in the 'edit playlist' image. However, when I look at the playlist view none of my playlists have the images that can be seen in the edit view. I've tried restarting the device, renaming the file to not have spaces, and even overwriting the EXTIMG info directly to add the extension, all of which has failed. Any ideas what's happening?


Attached Files Thumbnail(s)
       
Reply
#5
Ah, I see! if EXTIMG is 'local' then the image shows in the playlist view just fine. Thanks for the help!
Reply
#6
@taynaron

Are you intending to do this infrequently in a batch operation or frequently?

If the former, I'd do just as I do when I'm uploading zip files whose contents will end up in protected parts of the moOde filesystem. First, upload to my moOde user's home directory (or a suitable subdirectory I've already created). Then, in moOde, move or copy the files to their final destination as superuser (e.g., using sudo), perhaps adjusting their permissions when done.

The advantage in your case is that the result is indistinguishable from moOde's default setup and, for example, the playlists and playlist-covers can be backed up along with the rest.

OTOH, I see no reason why the permissions on the playlist-covers directory should be any more restrictive than they are on the playlist directory (/var/lib/mpd/playlists is :wide open").. You could change the permissions temporarity or permanently to do your uploading. [Before any security auditors object, I'd point out that moOde hasn't been audited as a system, is a single-user system intended to be behind a well-armed firewall.]

Regards,
Kent
Reply
#7
I am planning on the former, and so will consider if more security needed. That said, I am in a local environment behind a secure firewall so I think security is not my top priority for Moode. Thanks!
Reply
#8
On the thought of further automating things, curl "http://moode/command/?cmd=upd_library" updates the library (thanks for this!); is there a way to also regenerate the album thumbnails via command? Update library should be sufficient if we're just adding to a library, but if we edit existing songs update is insufficient.
Thanks!
Reply
#9
Update library will pick up any changes to song file metadata and cover art.

Here's what appears in the startup log
Code:
20250123 140401 worker: Job update_library
20250123 140401 mpdindex: Start
20250123 140401 mpdindex: Cmd (update)
20250123 140401 thumb-gen: Start
20250123 140401 thumb-gen: Scan opt: Default+
20250123 140401 thumb-gen: Priority: Embedded cover
20250123 140401 thumb-gen: Res,Qual: 600px,60
20250123 140401 thumb-gen: Px ratio: 1
20250123 140401 thumb-gen: Th width: 600
20250123 140401 thumb-gen: Thm qual: 60
20250123 140401 thumb-gen: Scanning: NAS, NVME, SATA, SDCARD
20250123 140406 thumb-gen: Done: 377 folders scanned, 0 thumbs created, 377 already in cache.
20250123 140413 mpdindex: Done: indexed 293 artists, 376 albums, 4189 songs
20250123 140413 worker: Job update_library done

Regenerating the library is almost never needed unless you did a lot of pruning and want to get rid of orphaned thumbnails.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: