IncrementPlayerCount / DecrementPlayerCount

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: IncrementPlayerCount / DecrementPlayerCount

Re: IncrementPlayerCount and set Last Played to now

by OzPonder » Sun Aug 14, 2022 9:33 pm

I found this thread researching options to resolve a similar sync need, and followed the suggestion to clone and modify the swapArtistTitle script to achieve both incrementing the playCounter and Last Played date (I drive a few smart playlists from Last Played). Here it is if it helps anyone:

Code: Select all

// C:\Program Files (x86)\MediaMonkey 5\Scripts\setLastPlayed\actions_add.js
// A simple script that sets last played
actions.setLastPlayednow = {
    title: _('Set Last Played to now'),
    hotkeyAble: true,
    disabled: uitools.notMediaListSelected,
    visible: window.uitools.getCanEdit,
    execute: async function () {
        var list = await uitools.getSelectedTracklist().whenLoaded();
        if (list. Count === 0) {
            return;
        }
		
        var msg = sprint(_('Are you sure that you want to set Last Played to now on %d files ?'), list.count);
        messageDlg(msg, 'Confirmation', ['btnYes', 'btnNo'], {
            defaultButton: 'btnNo',
            title: _('Set Last Played to now'),
        }, function (result) {
            if (result.btnID === 'btnYes') {
				var tmp;
				list.forEach(function(itm) {
					// Swap the fields
					itm.beginUpdate();
					itm.lastTimePlayed_UTC = app.utils.timestamp2DateTime( new Date().toISOString());
					itm.playCounter = itm.playCounter + 1;
					itm.endUpdate();
				});
				list.commitAsync();  
            }
        });                      
    }
}

window._menuItems.editTags.action.submenu.push({
        action: actions.setLastPlayednow,
        order: 22,
        grouporder: 10
});

Re: IncrementPlayerCount / DecrementPlayerCount

by Erwin Hanzl » Sat Jun 18, 2022 2:03 am

If you read my post carefully, I'm referring to individual songs, with a note on multi-selection - direct entry of the Played# value.
NOTHING is added.

And no, I have no problem with your reference.

Re: IncrementPlayerCount / DecrementPlayerCount

by Barry4679 » Fri Jun 17, 2022 10:15 pm

Erwin Hanzl wrote: Fri Jun 17, 2022 6:01 am This request was from 20.9.2021 - and today, 9 months later, you answer.
I didn't notice that the beginning of this thread was that long ago.
But I was primarily responding to your suggestion from a few days ago.
There is a bug worth knowing about in the facility that you suggesting.
I wanted to warn about that. You have a problem with that?

Re: IncrementPlayerCount / DecrementPlayerCount

by Erwin Hanzl » Fri Jun 17, 2022 6:01 am

The OP was asking for something where plays could be altered at the album level.
This request was from 20.9.2021 - and today, 9 months later, you answer.
I have listed alternatives to the request of 6/6/2022 and the first post 16.09.2021

Re: IncrementPlayerCount / DecrementPlayerCount

by Barry4679 » Fri Jun 17, 2022 4:50 am

Erwin Hanzl wrote: Mon Jun 06, 2022 11:25 am You can change directly under "Properties" (also Multi Select) or:
The OP was asking for something where plays could be altered at the album level.

As you say, you can multi-select the tracks, but there is a trap (bug?) to be aware of.
Say the album has 3 tracks, each with 2 plays. In this case Track Properties will display Play Count of 6 (I.e 3*2 = 6) when you ,multi-select all tracks for the album.

But if you make an alteration to this value, it assigns your new value to each of the tracks.
ie. if you change this whole album play value from 6 to 9, you end up with each track having a play count of 9, giving an album play count of 27!

ie. it displays Play Count for a selection of tracks, as the sum of all play counts ... but it forgets this if you make a change, and it writes your value to every track in your selection..

[UPDATE] Issue tracked as https://www.ventismedia.com/mantis/view.php?id=19190

Re: IncrementPlayerCount / DecrementPlayerCount

by Erwin Hanzl » Mon Jun 06, 2022 11:25 am

You can change directly under "Properties" (also Multi Select) or:
Alternative: View detail ... activate the "Played" field ... you can enter the value directly there.

Image

Re: IncrementPlayerCount / DecrementPlayerCount

by LifeTheLiving » Mon Jun 06, 2022 7:02 am

Thank you for your comment.

I'm NOT a programmer.

Has anyone made the script yet?

Re: IncrementPlayerCount / DecrementPlayerCount

by Ludek » Tue Jan 04, 2022 10:43 am

Actually making such an addon should be very easy.

You can use existing /scripts/swapArtistTitle/ addon.

And just modify parts of it , namely instead of using:

Code: Select all

itm.title = itm.artist;
use

Code: Select all

itm.playCounter = itm.playCounter + 1;

Re: IncrementPlayerCount / DecrementPlayerCount

by Peke » Mon Jan 03, 2022 9:22 pm

Hi,
If someone wants to pick it up value can be Set/Get easily thru https://www.mediamonkey.com/docs/api/cl ... layCounter

Re: IncrementPlayerCount / DecrementPlayerCount

by LifeTheLiving » Mon Jan 03, 2022 3:37 am

Still very interested :-)

The manual way works but like for MM4, I will pay for such an addon :lol: :lol: :lol:

Re: IncrementPlayerCount / DecrementPlayerCount

by LifeTheLiving » Mon Sep 20, 2021 4:57 pm

Barry4679 wrote: Mon Sep 20, 2021 3:29 am
LifeTheLiving wrote: Fri Sep 17, 2021 2:23 am In the file listing I can get it to edit. However often it start to play instead of editing.
If you find that you are accidently starting track often, you can alter MM default.
The default action when the Enter key is pressed, or the tracks is double clicked, is to play the select track(s).
This can be changed, so that default action is to open the Track properties panel for the selected track(s).

see here
Thank you very much. I have changed that.

If anyone makes a increment / decrement addon for MM5, please let us know. I can do it manually one track at a time, but most often i play a whole album, and I used to select the whole album and say increment by one. That was convinient.

Re: IncrementPlayerCount / DecrementPlayerCount

by Barry4679 » Mon Sep 20, 2021 3:29 am

LifeTheLiving wrote: Fri Sep 17, 2021 2:23 am In the file listing I can get it to edit. However often it start to play instead of editing.
If you find that you are accidently starting track often, you can alter MM default.
The default action when the Enter key is pressed, or the tracks is double clicked, is to play the select track(s).
This can be changed, so that default action is to open the Track properties panel for the selected track(s).

see here

Re: IncrementPlayerCount / DecrementPlayerCount

by LifeTheLiving » Fri Sep 17, 2021 1:09 pm

Thank you very much.

Found them both.

Re: IncrementPlayerCount / DecrementPlayerCount

by Ludek » Fri Sep 17, 2021 9:02 am

See Properties > Details > Play counter: [...]

BTW: Use F2 key in filelisting for faster edits

Re: IncrementPlayerCount / DecrementPlayerCount

by LifeTheLiving » Fri Sep 17, 2021 2:23 am

Thank you for your anwers.

I don't synchronize, it words fine manually.

In the file listing I can get it to edit. However often it start to play instead of editing.

It would be better in properties, but I Just can't find it in there, unless it somehow has to be added manually under custom?

Top