|
Post by GoneMAD on Jul 6, 2021 10:07:04 GMT -5
"What defines an album then?"
GMMP groups albums by album tag + albumartist tag if the music is in the same folder (if no albumartist tag is present it'll group by album tag in the same folder. If the artists are different it gets marked as a various artists album). If your music is in different folders it groups albums by the album tag + albumartist tag + year tag
There are some options regarding whether to use the year tag or not in the scanner settings but for most people that doesnt need to be touched
Why are things grouped this way you may ask? The answer is some people like chaos and throw all their music into a single folder, or just have folders for the artist with all the files from that artist in the folder. Organizing music and tagging music is something that apps / programs took way too long to follow the standards so there are so many people out there with different looking collections and music tagged differently
|
|
|
Post by GoneMAD on Jul 6, 2021 11:27:54 GMT -5
sorry slowly going through the questions "I would like a clarification, though: in the album view shown above, you do show a cover image. Where do you get it from?! There are different files potentially in different folders; each file could have a different embedded image and each folder could have a folder.jpg image in it. Could you not fill %fo% with a default value using some similar heuristics? I mean, if all files *happen* to be in the same folder, this would be right. Maybe you could use the folder name of the first track for %fo%, for instance. Would that make some sense? It would not be worse, conceptually, than the heuristic you must be using today to decide what is the album cover image, I guess...." gonemadmusicplayer.blogspot.com/p/artwork-priorities.html
|
|
|
Post by GoneMAD on Jul 6, 2021 13:50:13 GMT -5
Since I finally retyped the string of %fp%, I tried to substitute it literally in Line 15 to see what happens (essentially what I think you might have wanted to do on your side). - A first issue is that %fp% contains parentheses which, when literally pasted in place of %fp% may create parsing issues. But they are matched, so they may work per chance (there is no guarantee, of course, that a file path contains parentheses matched and it is perfectly legal to have an unmatched ")" in a file path...).
- I have no clue if there is a way to protect the strings in the functions while allowing for %fp% expansion (something like double quotes in C shell or Perl). A single quote clearly does not work (it seems to be a literal) and a double quote might interfere with the JSON double quote. An escaped \" maybe? My apologies if I have not read carefully the instructions, but this is almost certainly a problem I need to handle.
- Unless I made a stupid mistake, I removed the ()'s from the literally pasted %fp% just as a test and it still seems not to work, but in a different way: it simply does not print anything. Here is the line I entered in the JSON file:
["<align=left><size=16><wrap>16: $right(/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente 1710-1805/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 1730-1760 -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3,$add($len(/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente 1710-1805/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 1730-1760 -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3),-$strstr(/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/Dall'Abaco, Giuseppe Clemente 1710-1805/2. Chamber/Sonata for Cello and Continuo in A major, ABV30 1730-1760 -- Frey, Valli, Bianchi F., Pinardi/01 -- Andante.mp3,audio/mp3/Classical/),-$len(audio/mp3/Classical/)))"], I hope it is correct, because in such a mess it is hard to detect small typos....
() or other characters that are contained in variables should be fine. They get expanded after the function is parsed. So far there are variables for literal ( ) comma and space. In 3.2 i'll add an $utf8(code) that will let any unicode character be used without the worry of messing up the parsing Now that you gave me an example i can step through the debugger and see whats going on with line 15. The first post should state that i did not test the combination of every function and visually inspecting the line seems fine, so my guess would be a bug in one of the functions and or the use of the function when nested
|
|
|
Post by GoneMAD on Jul 6, 2021 13:58:33 GMT -5
Of course there are many ways to personalize this, as you have done for your library management preferences. The "Composer" tag is somewhat helpful, and Apple recently introduced tags for "Work" and "Movement" specifically to help, but these only apply to m4a format and are not standard at this time. And I don't think GMMP uses them in the library build either. Adding "Work" and "Movement" on top of "Album" seems a wise decision, and perhaps sort of the only one which truly makes sense. Regardless there is, as the saying goes, more than one way to skin a cat. So based on your usage of the tags, we just need to figure out how best to get the metadata to display in GMMP from what you have. I'll run through some ideas with your examples and see if I can throw out an alternative solution. I am sorry, but I am a firm believer that there should be only one way to skin a cat--which is, a standard. Alas, neither you nor I can change that, but it is horrific to me that professionals in this field have not understood over decades of music in electronic formats that this is the only meaningful way to go. What I would like to have is something supersimple: I would like to have %cp% with the composer for any track that has the COMPOSER field in any view I care for. I am struggling to find a workaraound to that, that's it--and, in truth, I am close to give up. hopefully the composer as a variable in more views does get fixed in the next update (i checked my notes and i believe there was a potential solution that should work, just need to try it out).. but i dont expect 3.1.3 until the end of the month As far as standards, the id3v2.4 spec was released in the year 2000 lol. The problem is that most apps / programs don't implement the spec. For gmmp, i follow the spec (the tagging library used is pretty good about spec compliance). For non standard tags i'll look at what foobar2000 and itunes use as they tend to define the unofficial standards for certain fields (like the user defined TXXX tag)
|
|
|
Post by GoneMAD on Jul 6, 2021 20:43:25 GMT -5
okay.. so i think i know whats going on with line 15. Firstly $right will fail with negative numbers. I added that to the bug list. Secondly to negate a number you need to do a multiply by -1 instead of just putting a negative sign in front of it. If the result of $strstr or another function is negative.. the result is going to be --1 which doesnt parse into a number and will fall back to 0.
All that being said it appears that %strstr is not finding the string and returning -1 and causing the result of $add to be less than 0. How is that possible since the filenames are so long? Well the UI where you select the custom metadata uses some dummy data to display the metadata lines.. the dummy path is /Full/Path which is smaller than audio/mp3/Classical/, so it ends up negative. I would guess even tho its blank.. if you were able to select it, now playing would show things correctly
|
|
|
Post by MotleyGord on Jul 7, 2021 6:48:11 GMT -5
I am sorry, but I am a firm believer that there should be only one way to skin a cat--which is, a standard. Alas, neither you nor I can change that, but it is horrific to me that professionals in this field have not understood over decades of music in electronic formats that this is the only meaningful way to go. What I would like to have is something supersimple: I would like to have %cp% with the composer for any track that has the COMPOSER field in any view I care for. I am struggling to find a workaraound to that, that's it--and, in truth, I am close to give up. A standard will always have exceptions, that is just reality. I have one for my preferences, you have a different one. Neither is wrong. Until the already identified GMMP issue for %cp% is fixed to allow it to be used in more views, I do think a work around is still possible with the info you have in %fp% - if your file naming is standard. It appears that the first 56 characters are fixed and what you want stripped. So have you tried something like… “$right(%fp%,$len($sub(%fp%,56)))” …in this case? The actual length of 56 may need to be corrected, but as long as it is consistent to your full path it should do the trick.
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 7, 2021 7:16:43 GMT -5
It appears that the first 56 characters are fixed and what you want stripped. So have you tried something like… “$right(%fp%,$len($sub(%fp%,56)))” …in this case? The actual length of 56 may need to be corrected, but as long as it is consistent to your full path it should do the trick. Thanks. I am not sure what this code means, for you seem to be subtracting 56 from a string and asking for the $len of a number, but I think you mean something similar to what I have been desperately trying to do, except for using a fixed size for the prefix. The corrected version would probably work, but I wanted something a tad more robust, just in case tomorrow the Android path changes.... Again, thanks, but I am giving up (see next post with more experiments) and will simply hope for %cp% to be fixed--in any case, it is not urgent at all!
|
|
|
Post by GoneMAD on Jul 7, 2021 7:43:55 GMT -5
for the record i modified your line 15 with "Music/" instead of the path you had and it worked fine. Paths on android are case sensitive.. so maybe that was it?
Anyway yea probably best to just wait for the fix if you cant get it
What motley suggested should be $right(%fp%,$sub($len(%fp%),56)) or you could use $replace(%fp%,/storage/9C33-6BBD/home/ienne/media/audio/mp3/Classical/,) That replace that first path with an empty string
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 7, 2021 7:50:58 GMT -5
@gonemad I am not sure I understood everything in your previous post, but (1) negative numbers in $add seem to work in other situations, (2) I had tried with $sub (which should be perfectly equivalent and completely avoids negative numbers) but nothing changed, and (3) I understood that you suppose the problem is that the function fails on the dummy data. About the last point, which appears to be the only possible killing one, I tried these: ["<align=left><size=16><wrap>17: $if($greater($strstr(%fp%,audio/mp3/Classical/),0),Found,Not found)"], // ["<align=left><size=16><wrap>18: $if($greater($strstr(%fp%,audio/mp3/Classical/),0),$right(%fp%,$add($len(%fp%),-$strstr(%fp%,audio/mp3/Classical/),-$len(audio/mp3/Classical/))),No composer)"], // ["<align=left><size=16><wrap>19: $if($greater($strstr(%fp%,audio/mp3/Classical/),0),$right(%fp%,$sub($len(%fp%),$strstr(%fp%,audio/mp3/Classical/),$len(audio/mp3/Classical/))),No composer)"], Line 17 seems to indicate that I understand how $if and $greater work and gives "Not found" on the dummy data or "Found" on the real data. Yet neither line 17 nor 18 are accepted; the only reason I can imagine (if the theory of negative values on the dummy data is correct) is that you do an eager evaluation of both the true and false expressions, although I do not see why you would do that; otherwise, the parser has some serious problems. In the former case, one could probably fix things by doing a $max with 0 of all numbers on the invalid side of the $if--which would give some random result (but it is the invalid side, so who cares) and make the eager evaluator happy. Honestly, I thank you for the help but this is way too laborious to be worth it (and I am blindly debugging something while making weird hypotheses on what might be happeneing). I will wait for %cp% to be available everywhere, if possible--and hopefully also for albums with some precedence heuristic similar to the one used for artwork. Thanks!
|
|
|
Post by MotleyGord on Jul 7, 2021 7:54:16 GMT -5
Thanks. I am not sure what this code means, for you seem to be subtracting 56 from a string and asking for the $len of a number, but I think you mean something similar to what I have been desperately trying to do, except for using a fixed size for the prefix. The corrected version would probably work, but I wanted something a tad more robust, just in case tomorrow the Android path changes… A little dyslexic on that, apologies for typing before my first coffee of the day. The returned result should be the full path name, less the first 56 characters, which is before the “Dall’Abaco…” you wanted. If your base directory path does change, you can update the length accordingly, at least until the %cp% function is updated. “$right(%fp%,$sub($len(%fp%),56))” Assuming this is consistent for all of your music files, it should return the desired display. The path should not change unless you reformat the card or move the files intentionally.
|
|
|
Post by GoneMAD on Jul 7, 2021 9:08:08 GMT -5
@gonemad I am not sure I understood everything in your previous post, but (1) negative numbers in $add seem to work in other situations, (2) I had tried with $sub (which should be perfectly equivalent and completely avoids negative numbers) but nothing changed, and (3) I understood that you suppose the problem is that the function fails on the dummy data. About the last point, which appears to be the only possible killing one, I tried these: ["<align=left><size=16><wrap>17: $if($greater($strstr(%fp%,audio/mp3/Classical/),0),Found,Not found)"], // ["<align=left><size=16><wrap>18: $if($greater($strstr(%fp%,audio/mp3/Classical/),0),$right(%fp%,$add($len(%fp%),-$strstr(%fp%,audio/mp3/Classical/),-$len(audio/mp3/Classical/))),No composer)"], // ["<align=left><size=16><wrap>19: $if($greater($strstr(%fp%,audio/mp3/Classical/),0),$right(%fp%,$sub($len(%fp%),$strstr(%fp%,audio/mp3/Classical/),$len(audio/mp3/Classical/))),No composer)"], Line 17 seems to indicate that I understand how $if and $greater work and gives "Not found" on the dummy data or "Found" on the real data. Yet neither line 17 nor 18 are accepted; the only reason I can imagine (if the theory of negative values on the dummy data is correct) is that you do an eager evaluation of both the true and false expressions, although I do not see why you would do that; otherwise, the parser has some serious problems. In the former case, one could probably fix things by doing a $max with 0 of all numbers on the invalid side of the $if--which would give some random result (but it is the invalid side, so who cares) and make the eager evaluator happy. Honestly, I thank you for the help but this is way too laborious to be worth it (and I am blindly debugging something while making weird hypotheses on what might be happeneing). I will wait for %cp% to be available everywhere, if possible--and hopefully also for albums with some precedence heuristic similar to the one used for artwork. Thanks! negative works until it doesnt. if the function results in a positive number.. making it negative is fine.. if the function results in a negative number.. then it ends up --1 2 negative signs is not valid. This is only an issue if strstr doesnt find a match and it returns -1 did you try line 15 as you had it before.. its not going to show up in the preview but should show up when selected for now playing. The preview in the custom metadata screen uses dummy data which messes up your functions because the file path does not contain audio/mp3/Classical, but using it with real data (like in now playing).. it should work
|
|
|
Post by GoneMAD on Jul 7, 2021 9:26:53 GMT -5
"and hopefully also for albums with some precedence heuristic similar to the one used for artwork." albums will always use the method i mentioned in one of my previous posts: gonemadmusicplayer.proboards.com/post/7952so tag based with using folders to help some decisions whether similar tagged music should be grouped together
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 7, 2021 9:32:39 GMT -5
did you try line 15 as you had it before.. its not going to show up in the preview but should show up when selected for now playing. The preview in the custom metadata screen uses dummy data which messes up your functions because the file path does not contain audio/mp3/Classical, but using it with real data (like in now playing).. it should work It is not that I do not like the dummy data and do not select it: as soon as that line or the other commented out are included, I get nothing to select. Here is the example I showed yesterday:
I also tried this, avoiding the potential minus in front of a negative number
["<align=left><size=16><wrap>15b: $right(%fp%,$sub($len(%fp%),$strstr(%fp%,audio/mp3/Classical/),$len(audio/mp3/Classical/)))"],
but, again, I cannot select it because there is nothing to select. I have absolutely no clue why and I am pretty convinced that this code is up to the spec.
Sorry, I need to give up, it is impossible for me to write any meaningful code and understand what is going on, at this point. I'd love if %cp% could be made to work everywhere including for albums (with any heuristic you like to select from which file in the album to take COMPOSER, since all my "albums" are consistent)--that would be fantastic! :-)
|
|
|
Post by GoneMAD on Jul 7, 2021 11:29:58 GMT -5
ah okay.. gotcha. once $right is fixed that would at least present something to select
If the fix i have in mind works %cp% would be available in (Now Playing, Composer, Queue, Song/Album Details, Bookmark, Playlist, AudioFile), possibly in Album List as well. I cant remember if Composer and Album get associated together in the database without looking at the code
|
|
paolo
New Member
Posts: 42
|
Post by paolo on Jul 7, 2021 14:01:20 GMT -5
Thanks!
|
|