Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always turns Single Artist Names into Character Lists #6

Open
Reasonable-Grape2698 opened this issue Oct 1, 2024 · 3 comments
Open

Comments

@Reasonable-Grape2698
Copy link

https://github.com/AIGMix/AIGPY/blob/master/aigpy/tagHelper.py issue is in this file, it has trylist for both albumartist and artist which joins anything over 1 character in length.

The issue is it also joins actual strings by commas,, one character at a time

@Reasonable-Grape2698
Copy link
Author

Ie Example becomes E, x, a, m, p, l, e.

@Reasonable-Grape2698
Copy link
Author

Reasonable-Grape2698 commented Oct 1, 2024

Something like

def __tryList__(obj):
    if obj is None or len(obj) <= 0:
        return ''
    if isinstance(obj, str):
        return obj if obj is not None
    return ", ".join(obj)

Should work

edit:

if obj is not None is covered already and not needed

Only tested as a demo, results as expected.

input = "test"
input2 = ["test1", "test2"]
input3 = ["test"]

def trylist(obj):
    if obj is None or len(obj) <= 0:
        return ''
    if isinstance(obj, str):
        return obj if obj is not None
    return ", ".join(obj)
    
print(trylist(input))
print(trylist(input2))
print(trylist(input3))

@Reasonable-Grape2698
Copy link
Author

Created pull request with fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant