I've been evaluating a few different streaming server options over the past few months. I'm coming over from iTunes / syncing which is becoming too cumbersome for me. I wanted a service that would give me one of iTunes more useful features - smart playlists. This is not available as standard in Subsonic, but with a bit of SQL manipulation I managed to get a solution.

Then variations of the following are issued to add items into a playlist by the "modification" date of the source file. "The 30 + 1" bit refers to the amount of days prior to todays date to include in the playlist. I did write an additional shell script to make sure all my file mod dates were equal to the date that they were added to iTunes. I'll include that later on:

I did have an issue whereby it was difficult for me to get all of my previously starred (or "loved" in iTunes) items to show up as "starred" in Subsonic. It's easy in Madsonic - import a .m3u playlist, "select all" then "star all" (or similar). Not so easy in Subsonic, so it needed additional db work:

if [ ! -z "$fullpath" ] # If a valid filepath has been found then parsedpath=`printf "%b\n" "${fullpath//%/\\x}" | sed 's/#38;//g'` # converts the %20 and others to a form that bash recognises, the "sed" deals with "&" characters which the conversion misses. The "g" option is global - replaces all instaces setfile -d "$month/$day/$year 01:00:00" -m "$month/$day/$year 01:00:00" "$parsedpath" # "setfile" above is a Mac OSX command which enables full modification of the "created" and "modified" dates. You can use the "touch" command as an alternative - commented out below #touch -t "$year""$month""$day"0100.00 '$fullpath' #touch -t "$year""$month""$day"0100.00 "$parsedpath"

Interesting stuff. I'll 'bookmark' this, and maybe someday add some code into SubFire Radio (a "smart" playlist randomizer, but only provides features available through the public API) that can read/write to db.view. Mod time means little to me for my collection and interests, but it would make a good experiment to try to add before getting more detailed in other parts of the DB that aren't yet exported in the API.

Bah. Updated: db.view doesn't send a CORS header, nor does it acknowledge the REST api's parameters nor the existing session from another tab (which I can use to get past any HTTPS cert issues), so I can't use this as an option for adding new capabilities now.

acroyear wrote:Interesting stuff. I'll 'bookmark' this, and maybe someday add some code into SubFire Radio (a "smart" playlist randomizer, but only provides features available through the public API) that can read/write to db.view. Mod time means little to me for my collection and interests, but it would make a good experiment to try to add before getting more detailed in other parts of the DB that aren't yet exported in the API.

Bah. Updated: db.view doesn't send a CORS header, nor does it acknowledge the REST api's parameters nor the existing session from another tab (which I can use to get past any HTTPS cert issues), so I can't use this as an option for adding new capabilities now.

Hi, yes I do remember finding subfireplayer in my initial research trying to find a solution. The "date added" thing is important for me. I'm pretty busy and tend to pick up music on the run after hearing bits on the radio etc. I was finding that things often disappeared in my large library. Using the dated playlists helps a lot with that.

Now, I might be able to simulate that by looking through the most-recent-albums list, which I *think* is modified even if a song is added to an existing album, and then filtering the songs within it (the song entries have the created date within) to get you that kind of a list. Last year and two might still be a somewhat expensive operation, but certainly possible. I'd have to know to stop looking for more albums once I ran out of songs inside the date range.

DELETE FROM playlist_file WHERE PLAYLIST_ID = 5;INSERT INTO playlist_file (MEDIA_FILE_ID, PLAYLIST_ID)SELECT ID, '5'FROM media_file WHERE DATEDIFF('day', "CHANGED", CURRENT_DATE) <= 730 + 1 AND TYPE='MUSIC' AND ID NOT IN (SELECT media_file_id FROM playlist_file where playlist_id = 9) OR DATEDIFF('day', "CHANGED", CURRENT_DATE) <= 730 + 1 AND TYPE='VIDEO' AND ID NOT IN (SELECT media_file_id FROM playlist_file where playlist_id = 9)SELECT COUNT(*) FROM playlist_file WHERE PLAYLIST_ID=5;

The above selects all music and video items added in the past 2 years and adds to playlist "5" while avoiding all items which are present in the playlist with id "9". Playlist "9" is my "Kids music" playlist for my 6 year old. This way I can have dated playlists as my examples above which avoid all the Disney music that he likes.

This is a very interesting post. I'm new in subsonic, I installed it today. Thanks to mwpmorris and this post I've been able to take all my stared songs from Synology audio station and import them into Subsonic I really don't know how you found all these database scripts but would it be possible to do the following :- create a playlist with starred songs, of mp3s placed in a given parrent directory (and its subdirectories)- take only 100 of these songs randomly and create a playlist to make it smaller than a full playlist- automate this everyday, so when I go into my car, the playlist changes every morning. For this last step I think I might use the curl command you've posted. But I don't understand what is this "cookiefile"Thank you again