|
Post by GoneMAD on Apr 17, 2020 16:34:39 GMT -5
Note sure if this is by design or a bug, but any trailing spaces in IF statements that are expected to be displayed are being dropped. I used this line where the red underscore is actually a space $ifequal($stricmp(%al%,%ar%),0,,%ar% •) _%al% (%yr%) but it adds an unnecessary space in the actual display before %al% if the IFEQUAL returns true. I would prefer to use it the following way with the space moved inside the IF statement $ifequal($stricmp(%al%,%ar%),0,,%ar% • _)%al% (%yr%) but this space is being dropped when displayed in GMMP. Same will go for this when $strstr is fixed, so it will look like this $ifequal($strstr($lower(%al%),$lower(%ar%)),-1,%ar% • _,)%al% (%yr%) This will enhance the current display such that any album title that contains the artist name anywhere will not be duplicated, i.e. and songs from "The Beatles Greatest Hits" will not show "The Beatles" as an artist, but songs from "Abbey Road" will. I Assume there is no function like $stristr that would be case-insensitive? G yeah i think white space on the ends get trimmed, i'll see what i can do. Might have to do it situationally. Like if you had a parameter that was supposed to be a number.. but you had a whitespace at the beginning or end, it would fail to parse into a number, so that why i was trimming it for everything
|
|
|
Post by MotleyGord on Apr 17, 2020 19:05:53 GMT -5
Note sure if this is by design or a bug, but any trailing spaces in IF statements that are expected to be displayed are being dropped. I used this line where the red underscore is actually a space $ifequal($stricmp(%al%,%ar%),0,,%ar% •) _%al% (%yr%) but it adds an unnecessary space in the actual display before %al% if the IFEQUAL returns true. I would prefer to use it the following way with the space moved inside the IF statement $ifequal($stricmp(%al%,%ar%),0,,%ar% • _)%al% (%yr%) but this space is being dropped when displayed in GMMP. Same will go for this when $strstr is fixed, so it will look like this $ifequal($strstr($lower(%al%),$lower(%ar%)),-1,%ar% • _,)%al% (%yr%) This will enhance the current display such that any album title that contains the artist name anywhere will not be duplicated, i.e. and songs from "The Beatles Greatest Hits" will not show "The Beatles" as an artist, but songs from "Abbey Road" will. I Assume there is no function like $stristr that would be case-insensitive? G yeah i think white space on the ends get trimmed, i'll see what i can do. Might have to do it situationally. Like if you had a parameter that was supposed to be a number.. but you had a whitespace at the beginning or end, it would fail to parse into a number, so that why i was trimming it for everything Can texts strings be kept together with single or double quotes ' " or similar? Might need to be escaped somehow like /' /" or \' \" etc.
|
|
|
Post by GoneMAD on Apr 17, 2020 20:55:59 GMT -5
yeah i think white space on the ends get trimmed, i'll see what i can do. Might have to do it situationally. Like if you had a parameter that was supposed to be a number.. but you had a whitespace at the beginning or end, it would fail to parse into a number, so that why i was trimming it for everything Can texts strings be kept together with single or double quotes ' " or similar? Might need to be escaped somehow like /' /" or \' \" etc. i could make it handle that. i'll have to think of the best way to do it. it might be better to only trim for parameters that cant handle whitespace.. which should only be params expecting a number
|
|
|
Post by viper21 on Apr 18, 2020 5:15:54 GMT -5
okay so it looks $ifgreater(%ra%,0,$rating(%ra%)) is not going to work for the time being. i know the issue but unfortunately i dont have a solution for the problem nevermind i thought of something that would work. I will add an optional extra parameter to $rating that will not show anything if rating is 0 or something like that Great. Thanks.
|
|
|
Post by MotleyGord on Apr 21, 2020 14:33:33 GMT -5
Here is my current favourite setup. Almost perfect, will be even better when $strstr() is updated. [ { "markupLines" : [ ["<align=center><typeface=sans-serif-black><size=22><wrap><b>%tr%</b>"], ["<align=center><typeface=sans-serif><size=15><color=accent><wrap>$ifequal($stricmp(%al%,%ar%),0,,%ar% •) %al% (%yr%)"], ["<align=center><typeface=sans-serif><size=10><color=secondary><wrap><i>$notempty(%cp%)</i>"], ["<size=6><blank>"], ["<align=center><typeface=sans-serif><size=10><color=secondary><b>%ps% / %tt%</b>"], ["<align=center><typeface=sans-serif><size=10><color=secondary>$upper(%ext%) • $div(%sr%,1000).$cut($mod(%sr%,1000),1)kHz • %br%kbps • %ch%"] ] } ] metadata_import_Artist_Album_Year_Composer....json (614 B)
|
|
|
Post by MotleyGord on Apr 23, 2020 9:30:09 GMT -5
Figures, got the update last night that fixed $strstr(). It works as expected now, thanks!
Here is my updated code now;
[ { "markupLines" : [ ["<align=center><typeface=sans-serif-black><size=22><wrap><b>%tr%</b>"], ["<align=center><typeface=sans-serif><size=15><color=accent><wrap>$ifequal($strstr(%al%,%ar%),-1,%ar% •,) %al% (%yr%)"], ["<align=center><typeface=sans-serif><size=10><color=secondary><wrap><i>$notempty(%cp%)</i>"], ["<size=6><blank>"], ["<align=center><typeface=sans-serif><size=10><color=secondary><b>%ps% / %tt%</b>"], ["<align=center><typeface=sans-serif><size=10><color=secondary>$upper(%ext%) • $div(%sr%,1000).$cut($mod(%sr%,1000),1)kHz • %br%kbps • %ch%"] ] } ] metadata_import_Artist_Album_Year_Composer....json (614 B)
|
|
|
Post by GoneMAD on Apr 23, 2020 10:16:39 GMT -5
Figures, got the update last night that fixed $strstr(). It works as expected now, thanks!
Here is my updated code now;
[ { "markupLines" : [ ["<align=center><typeface=sans-serif-black><size=22><wrap><b>%tr%</b>"], ["<align=center><typeface=sans-serif><size=15><color=accent><wrap>$ifequal($strstr(%al%,%ar%),-1,%ar% •,) %al% (%yr%)"], ["<align=center><typeface=sans-serif><size=10><color=secondary><wrap><i>$notempty(%cp%)</i>"], ["<size=6><blank>"], ["<align=center><typeface=sans-serif><size=10><color=secondary><b>%ps% / %tt%</b>"], ["<align=center><typeface=sans-serif><size=10><color=secondary>$upper(%ext%) • $div(%sr%,1000).$cut($mod(%sr%,1000),1)kHz • %br%kbps • %ch%"] ] } ] View Attachment oh wow thats awesome. Sounds like google finally got through their backlog and updates are going through quickly again
|
|
|
Post by arecad on May 4, 2020 9:04:14 GMT -5
Hey, thanks for sharing all of this. It works great and really allows for customization to our own tastes.
I do have a question about %ra%: seems no matter how I use this variable it always comes up as 0 on the now playing screen. I tried it as star ratings and I also tried it as its own numeric variable. It always shows zero no matter what. The songs are all rated too.
Is this broken? I noticed some comments about it not working when the song has no rating - maybe I am misunderstanding?
Thanks.
|
|
|
Post by GoneMAD on May 4, 2020 12:11:48 GMT -5
Hey, thanks for sharing all of this. It works great and really allows for customization to our own tastes. I do have a question about %ra%: seems no matter how I use this variable it always comes up as 0 on the now playing screen. I tried it as star ratings and I also tried it as its own numeric variable. It always shows zero no matter what. The songs are all rated too. Is this broken? I noticed some comments about it not working when the song has no rating - maybe I am misunderstanding? Thanks. What are your metadata lines? The only issue with rating right now is for some people it wont refresh after changing the rating of the current song until the UI is changed or the track changes (i cannot reproduce the issue as all my devices will update now playing immediately after changing rating)
|
|
|
Post by arecad on May 4, 2020 13:39:49 GMT -5
Hey, thanks for sharing all of this. It works great and really allows for customization to our own tastes. I do have a question about %ra%: seems no matter how I use this variable it always comes up as 0 on the now playing screen. I tried it as star ratings and I also tried it as its own numeric variable. It always shows zero no matter what. The songs are all rated too. Is this broken? I noticed some comments about it not working when the song has no rating - maybe I am misunderstanding? Thanks. What are your metadata lines? The only issue with rating right now is for some people it wont refresh after changing the rating of the current song until the UI is changed or the track changes (i cannot reproduce the issue as all my devices will update now playing immediately after changing rating) This is what is in my file right now (everything works but rating stars always blank) Screenshot below showing the rating over top the now playing screen [ { "markupLines" : [ ["<align=center><typeface=sans-serif-black><size=22><wrap><b>%tr%</b>"], ["<align=center><typeface=sans-serif><size=15><color=accent><wrap>$ifequal($strstr(%al%,%ar%),-1,%ar% •,) %al% (%yr%)"], ["<size=6><blank>"], ["<align=center><typeface=sans-serif><size=12><color=secondary><b>Playcount %pc%</b>"], ["<align=center><typeface=sans-serif><size=10><color=secondary>$upper(%ext%) • %br%kbps • %ch%"], ["<align=center><typeface=sans-serif><size=12><color=secondary><b>Skips %skp%</b>"], ["<align=center><typeface=sans-serif><size=18><color=secondary>$rating(%ra%)"] ] } ] metadata.json (657 B)
|
|
|
Post by GoneMAD on May 4, 2020 21:30:39 GMT -5
What are your metadata lines? The only issue with rating right now is for some people it wont refresh after changing the rating of the current song until the UI is changed or the track changes (i cannot reproduce the issue as all my devices will update now playing immediately after changing rating) This is what is in my file right now (everything works but rating stars always blank) Screenshot below showing the rating over top the now playing screen [ { "markupLines" : [ ["<align=center><typeface=sans-serif-black><size=22><wrap><b>%tr%</b>"], ["<align=center><typeface=sans-serif><size=15><color=accent><wrap>$ifequal($strstr(%al%,%ar%),-1,%ar% •,) %al% (%yr%)"], ["<size=6><blank>"], ["<align=center><typeface=sans-serif><size=12><color=secondary><b>Playcount %pc%</b>"], ["<align=center><typeface=sans-serif><size=10><color=secondary>$upper(%ext%) • %br%kbps • %ch%"], ["<align=center><typeface=sans-serif><size=12><color=secondary><b>Skips %skp%</b>"], ["<align=center><typeface=sans-serif><size=18><color=secondary>$rating(%ra%)"] ] } ] View AttachmentView AttachmentI used that metadata json and rating showed up fine. I looked at the differences between the rating pop up vs the code that displays the rating in now playing and it looks like rating pop up is taking it from the database and now playing is reading it straight from the tags in the file. I am guessing that something is preventing the tags from saving/writing, but the database updates fine. I will update now playing to read from the database in the next update
|
|
|
Post by arecad on May 5, 2020 12:29:01 GMT -5
I used that metadata json and rating showed up fine. I looked at the differences between the rating pop up vs the code that displays the rating in now playing and it looks like rating pop up is taking it from the database and now playing is reading it straight from the tags in the file. I am guessing that something is preventing the tags from saving/writing, but the database updates fine. I will update now playing to read from the database in the next update Thank you, I really appreciate it. That totally explains why it's not working for me.
|
|
|
Post by MotleyGord on May 5, 2020 18:05:42 GMT -5
Happy to see some of the code I posted was useful!
|
|
|
Post by arecad on May 6, 2020 9:53:46 GMT -5
Happy to see some of the code I posted was useful! Yes thank you!
|
|
|
Post by GoneMAD on May 12, 2020 9:17:04 GMT -5
finally updated the initial post to show the option ratings variable for min rating
|
|