Date added to a playlist

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Date added to a playlist

Re: Date added to a playlist

by Peke » Wed Nov 14, 2018 10:26 pm

Hi,
Create AddedToPlaylist.vbs in <MMW install folder>\Scripts\Auto\ and save below code in Notepad or any other Text Editor.

After that In Advanced Toolbar You will have button that would add Current Date To Original Date Library Tag.

Code: Select all

'==========================================================================
' NAME: AddedToPlaylist.vbs
' AUTHOR: Peke , 
' DATE  : 15.11.2018.
'==========================================================================
Sub OnStartup

  Dim SPlaylistadd
  Set SPlaylistadd = SDB.UI.AddMenuItem(SDB.UI.Menu_TbAdvanced,0,0)
  SPlaylistadd.Caption = "Added to Playlist"
  SPlaylistadd.OnClickFunc = "playlistadd"
  SPlaylistadd.UseScript = Script.ScriptPath
  SPlaylistadd.IconIndex = 63
 
End Sub

Sub playlistadd(arg)
  Script.Reload(Script.ScriptPath)
  Dim sSongs, TCdate, mitem
  
  If SDB.SelectedSongList.count = 0 Then
    Result = SDB.MessageBox( "You need to select track, please.", mtError, Array(mbOk))
    Exit sub
  End If
  TCdate = CDate(Date())
  
  Set Songs = SDB.SelectedSongList
  For mitem = 0 to SDB.SelectedSongList.count-1
    Songs.item(mitem).OriginalYear = DatePart("yyyy",TCdate)
    Songs.item(mitem).OriginalMonth = DatePart("m",TCdate)
    Songs.item(mitem).OriginalDay = DatePart("d",TCdate)
    Songs.item(mitem).UpdateDB
  Next
    
End Sub

Re: Date added to a playlist

by MrGerritson » Wed Nov 14, 2018 11:49 am

Hello Pavle,

I just stumbled across this thread and a scribt like you described it is exactly what I need.
I want to sort my Auto-Playlists in the order the tracks were added.
The trigger for the scribt shall be the updating of the playlist/the adding of new tracks.
Could you please also send me this solution if you have one?

Best regards
Gerrit

Re: Date added to a playlist

by lomah » Sun Apr 29, 2018 10:25 pm

Hi Peke,
Thanks for your reply and the offer of help, which I gratefully accept.
Please let me know what I have to do.
Thanks again.

Barry

Re: Date added to a playlist

by Peke » Sun Apr 29, 2018 2:39 pm

Hmm, if you you do not Use Original Date I can quickly write you button that would Add Current Date to Original Date Value for selected tracks and that you can use for Auto-Playlist criteria.

Also a button To clear the value.

Would that be workable?

Re: Date added to a playlist

by lomah » Sun Apr 29, 2018 9:31 am

Hi Peke,
Thanks for your suggestion, and I apologise for seeming slow but I don't fully understand how your method would work. Maybe I didn't explain properly. My Playlist structure is as follows:

1. To Replay -< Manually maintained simple Playlist
2. - Songs added to the Playlist "To Replay" within the last 7 days <- AutoPlayList
3. - Songs added to the Playlist "To Replay" between 7 and 14 days ago <- AutoPlayList
4. - Songs added to the above Playlist "To Replay" more than 14 days ago <- AutoPlayList
etc.
etc.
I understand that I can automatically add a date integer value to, say, field Custom 1 whenever I add a song to the PlayList "To Replay" (Although I don't know how to do that but I can probably figure it out). So the AutoPlayLists above would need to be able to search on field Custom 1 with a criterion of, say, today's date-Custom 1 value < 7, in the case of the first AutoPlayList above. If I look at the search criteria Condition for field Custom 1 in an AutoPlayList I only see contains, starts with, equals, doesn't contain, doesn't start with, doesn't equal, is unknown and is known. So, I'm lost. Please note that I only want to know if this is possible and, if so, pointed in the right direction and I'll do the research. Thanks again.

Barry

Re: Date added to a playlist

by Peke » Fri Apr 27, 2018 4:51 pm

Hi,
You can use Integer value (Unix Timestamp) where you can easily calculate date added.

it is actually easy https://www.epochconverter.com/programming/

Re: Date added to a playlist

by lomah » Fri Apr 27, 2018 1:52 pm

Hi Pavle,
Thanks for your suggestions. Automatically adding the date that a song was added to the playlist to a custom field would work but for the fact that a date value in a custom field would not, I believe, be searchable using date operators "< (days ago)" and "> (days ago)", unless I am missing something.

Re: Date added to a playlist

by Peke » Tue Apr 24, 2018 7:45 pm

Hi,
You can create new AutoPlaylists with criteria Playlist "TO Replay" and additional ones like not played >15 days and rated <3 stars.

You can also make script to use one of custom fields to save date when you add it to playlist.

Re: Date added to a playlist

by Lowlander » Tue Apr 24, 2018 11:11 am

This is not tracked, thus not available.

Date added to a playlist

by lomah » Mon Apr 23, 2018 10:51 pm

Does anyone know if it's possible to capture the date and time that a song is added to a Playlist? The reason is that I have a vast collection of songs in MM, and I maintain a manual Playlist of songs that I want to replay (either in MMW or MMA after syncing). This Playlist (simply named "To Replay") can be songs that I have recently added and want to replay before deciding on a rating, or songs that I just stumble across and want to replay, so add to the Playlist. I would like to be able to see when the songs were added to the PlayList so that I can sort it accordingly and review those that can maybe be removed due to their age. If this was possible, I could have child AutoPlaylists based on that date, e.g. songs added to the Playlist "To Replay" within the last 14 days, between 15 and 30 days, before 30 days etc.. So the field in the child AutoPlaylists would have to be selectable in the same way ad the "Added" field, e.g. ">", "<", "between", "< (days ago)" etc.
I hope that makes sense and that someone has an idea.

Top