Update for Artwork and Media Type

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.

Forgot to mention, I also made a few minor changes, such as changing Calendar to Schedule (better term in these radio applications), removing LibreTime in title page if a station name is set (eg. ‘Your Radio Station - Libretime’ is now ‘Your Radio Station’), Disabled the notification for “Update Available”. I already found the issue, seems like it’s just the versioning set not matching the version file, for now let’s just leave it disabled. I started working on the BPM detection and waveform to set cue point and gain visually. I’ll see if I can have an update on that soon. Might not be this week.

1 Like

Thanks for the contribution. As part of the C4 (community code collaboration contract) we require each PR to focus on a specific issue rather than contain a bunch of different contributions. This makes it easier to maintain the project and unwrap different contributions. I saw Kyle gave you a bunch of feedback on possible alterations. We will help you figure out how to do this if you need any assistance with the various git commands etc.

As you can see I’m still new to Github and that was the way I started, so I made those changes just to get it up and running on my server. As far as separating the PR, what do you suggest I do? I know how to create them and when I tried doing a pull request on one, I guess it included all the changes I’ve made before due to it being in the master. Not sure. I have to study it a bit more. Please let me know what’s the best approach and I will see if I can do it this week.

Ok so the tricky part is separating the different parts into different PRs. I’ll have to sit down at the computer and see if I can give particular suggestions. It may just involve “moving” certain commits to other branches and opening a new PR. I think this can be done through the cherry picking technique but my knowledge of git is not innate at this point so I still have to research the appropriate commands and I’m not at a spot to do this right this second. Hope this helps a little bit. I can try to be more specific later when I get a chance.