Hey guys, I know I said I was going to do a Pull Request last week but hold on to it so that I can fix a few things first. Since this was my first time contributing anything to GitHub I didn’t do any separate branches to my fork, I made all updates to the master.
Artwork
-
It will generate 6 jpeg files when uploading audio, if audio has artwork (32px, 64px, 128px, 256px, 512px, and 1024px)
-
It will also generate 4 files with DataURI resized that will be used across Libretime itself (32px, 64px, 128px, 256px). All files (jpeg and data URI) will only take about 140kb for each track.
-
If audio track is deleted, all the related image files will be deleted as well.
-
At the moment, if you have files already on a live server, you will need to click on the edit icon to edit track, and then simply click save. If no artwork was set before and the audio file has artwork, it will then retrieve it and save it to Libretime.
-
If no artwork or supported format is available, it will just give you a default track image.
-
I know there are plans to make a new API, but I included this to the current one. The URL can be found in api/live_info and also called by track ID. (eg. http://192.168.10.100:8080/api/track?id=129&return=artwork). You can return a JSON for other track info (return=json) or return other artwork sizes (return=artwork-32, return=artwork-128, return=artwork-256, return=artwork-512 or return=artwork-1024)
Media Type
I also added the Media Type feature for Tracks which makes it easier for us to tell apart the kind of tracks we’re dealing with and so we’re able to call it apart from genre (which is the way some were using it) with Smart Blocks and API. (eg. Station ID, Show Intro, Show Outro, Jingles, Sweepers, Commercials, Promo, Interview, Shout Out, News, Voice Tracking)
TODO: Artwork upload from edit tab.
For now, if you need to change artwork, I could only suggest for you to download the track, edit in iTunes or favorite meta tag editor and re-upload.
I might not be available this week so I will do the Pull Request now, but if anyone wants to test my fork and find any issues or improve on it, please do so: https://github.com/codenift/libretime
I have it working on a live server and using it on my app with no issues so far. Just make sure you back up everything if you’re trying to do the same. The database will be upgraded to include artwork and media_type.