Hiya,
I'm trying to add last played data from MediaMonkey to my Now Playing skin.
I have managed to get the data using a script in MM that writes the data into a txt file after song change and I have Rainmeter using Luascript to read that data and display it. Works great.
However when a song has not been played before MM scripts writes 00:00:00 into the txt file. How can rewrite my script in such a way that when it reads "00:00:00" in writes "Last Played Never" instead of "Last Played On %1"?
It's probably easy but I'm not that smart.
Thnx
It is currently April 28th, 2024, 6:50 am
If text is x then
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
-
- Rainmeter Sage
- Posts: 7178
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: If text is x then
Not sure if MediaMonkey works with NowPlaying, there are some plugins for their interaction though probably not for the most recent versions of MM. If it doesn't, maybe you have better luck trying the WebNowPlaying plugin and see what you get.Nachtschade wrote: ↑December 4th, 2023, 12:18 am Hiya,
I'm trying to add last played data from MediaMonkey to my Now Playing skin.
I have managed to get the data using a script in MM that writes the data into a txt file after song change and I have Rainmeter using Luascript to read that data and display it. Works great.
However when a song has not been played before MM scripts writes 00:00:00 into the txt file. How can rewrite my script in such a way that when it reads "00:00:00" in writes "Last Played Never" instead of "Last Played On %1"?
It's probably easy but I'm not that smart.
Thnx
As for the answer to your question, I assume that the code you have in the skin's .ini file is something like this:
Code: Select all
...
[MeasureProvidingData]
Measure=...
...
...
[MeterDisplayingData]
Meter=...
...
MeasureName=MeasureProvidingData
Text=Last Played On %1
...
...
Code: Select all
...
[MeasureProvidingData]
Measure=...
...
RegExpSubstitute=1
Substitute="^(.*)$":"On \1","^On (?:00:00:00|\\1)$":"Never"
...
[MeterDisplayingData]
Meter=...
...
MeasureName=MeasureProvidingData
Text=Last Played %1
...
...
Code: Select all
RegExpSubstitute=1
Substitute=...your existing substitutions...,"^(.*)$":"On \1","^On (?:00:00:00|\\1)$":"Never"
If you do the above correctly, it should yield the expected result. If it doesn't - and for the next time you ask something else on the forum - please provide the code you're having issues with (along with all its dependencies, like image resources, fonts, whatever is in the @include= lines, and so on) or just pack your skin and upload it here. It's only rarely that a coding issue can be solved without having access to the code in the first place - it's like asking someone to fix your computer without that someone being able to see the computer and figure out what's wrong with it.
-
- Posts: 24
- Joined: August 1st, 2017, 10:02 pm
Re: If text is x then
Excellent. Thank you so much.
This works fine. I've edited it a little more to make it say either "Last Played On 10-12-2019 00:14:11" or "Never Played Before", which is even more clean.
As for your question about MM working with NowPlaying. It does. At least MM4 does. I don't use 5 since all the great MM custom scripts for 4 don't work with 5 and many have not yet been ported and I rely on a few.
I've had a small Now Playing thingy going on in the corner of my second screen for years but I've gifted myself a dedicated Now Playing screen last week so now I'm trying to make my script better and more beautiful.
Work in progress: the screen will be mounted to the wall and I need to redesign fonts and stuff but it's coming along. I figured it was finally time to have some payoff for all the work I've put into perfectly tagging every last music file I have.
This works fine. I've edited it a little more to make it say either "Last Played On 10-12-2019 00:14:11" or "Never Played Before", which is even more clean.
As for your question about MM working with NowPlaying. It does. At least MM4 does. I don't use 5 since all the great MM custom scripts for 4 don't work with 5 and many have not yet been ported and I rely on a few.
I've had a small Now Playing thingy going on in the corner of my second screen for years but I've gifted myself a dedicated Now Playing screen last week so now I'm trying to make my script better and more beautiful.
Work in progress: the screen will be mounted to the wall and I need to redesign fonts and stuff but it's coming along. I figured it was finally time to have some payoff for all the work I've put into perfectly tagging every last music file I have.
-
- Rainmeter Sage
- Posts: 7178
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: If text is x then
Ah, I see - if you're happy with it, then it's all good (what we do for ... ourselves, right?).Nachtschade wrote: ↑December 4th, 2023, 2:39 pm Excellent. Thank you so much.
This works fine. I've edited it a little more to make it say either "Last Played On 10-12-2019 00:14:11" or "Never Played Before", which is even more clean.
As for your question about MM working with NowPlaying. It does. At least MM4 does. I don't use 5 since all the great MM custom scripts for 4 don't work with 5 and many have not yet been ported and I rely on a few.
I've had a small Now Playing thingy going on in the corner of my second screen for years but I've gifted myself a dedicated Now Playing screen last week so now I'm trying to make my script better and more beautiful.
Your adjustment does indeed sounds more natural, glad you managed to make it, that's the spirit.
EDIT: Just saw your edit and image - looks great. Next time I go to Sweden I'll make sure to check it out...