Closed Coloradohusky closed 1 year ago
So we have four different ItemName schemes to work with:
NOTE: Don't rely on ))
, what if album is (this (that) this)
I'll have to test it more in the morning, but I believe that this works for all cases (except when there are unbalanced parenthesis in the album name)
for test in list_strings:
song = test[::-1]
parenthesis = 0
for i in range(len(song)):
if (song[i] != ")" and song[i] != "(") and parenthesis == 0:
print(i)
print(song[1:i-1][::-1])
break
else:
if song[i] == ")":
parenthesis = parenthesis + 1
elif song[i] == "(":
parenthesis = parenthesis - 1
I.e. The Girl Gets Around (Footloose: The Musical)))
and The Girl Gets Around (((Footloose: The Musical)
doesn't work, due to the unbalanced parenthesis, but The Girl Gets Around (Foo()tloose(): The Musical()()()()())
works
Grab album title and track title from ItemName (artist title is already parsed)