OK! Had some real life stuff happen. Back at it for a second.
On thing I wanted to clarify, is that I thought you could link albums to Videos in relations, you cannot. outsidecontext was saying this the whole time, and it went straight over my head.
(You actually CAN link an album to a video but only under the heading of “samples from / sampled by” in the release relations. Though it’s not what that’s for and I think using that relationship incorrectly is a big no no.)
Thusly I guess I could ask if linking Music videos to original release albums is possible. But since it’s such an edge use case, It seems unlikely that it would get far, especially since it’s just my silly idea and their a probably better additions people are campaigning for.
That being said, it should still be possible to make a python script that gets the PROBABLY correct album (I say probably because the operations I came up with are based on a lot of assumptions, which 9/10 times should be right.)
But I hit a snag again. I still haven’t figured out how the API works yet, so I wrote out the operations as text to see where I was going with this.
#if media is video
# R = Relationship array
# if R =! null
# ID = music video for
# rA = ID.Release array
# if rA =! null
# for i=0; i < Ra.entries; i++
In that for loop its supposed to take all the albums linked in the release array, filter out every type that isn’t “Album” (So for Bang! no “Singles” and no “Album + Compilation”)
Then it takes the remaining albums and sorts them by release date. Whichever one has the earliest release date is used, if theirs a tie whichever one of those that has the lowest position in the Array is used.
So Like I said, very inaccurate but SHOULD work most of the time?
The wall I’ve run into is I can’t seem to find the type for the albums. The best I’ve got is “type-id” which could be it?
I’m going to keep trying but I figured this topic could use an update with everything I’ve learned in case other people want to try to do this but better.
Thanks again for all the help.