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

Export artist_poster.ext to the artist folder instead of the album folder #31

Open
jazzsnobeatcake opened this issue Jun 5, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jazzsnobeatcake
Copy link

jazzsnobeatcake commented Jun 5, 2021

Hi, thanks for the plugin. I got it to work after some trial and error. The last export I need to run involves the artist picture from my music library. I want the pictures to end up like this:

`music/

artist one/

    1999 - album one

    2003  - album two

    ...

    folder.ext

artist two/

    1981 - another album

    ...

    folder.ext

`

Right now, they end up in the album folders instead of the artist folder. This leads to duplicates and tricks playback software into choosing folder.jpg over cover.jpg, which already exist for every one of my albums.
Is it possible to make Lambda export the artist poster to the artist folder? I assume I'd have to enable the Lambda agent under Artists/Lastfm instead of Albums/Lastfm but there is no such checkbox.

Thanks and let me know if you need logs or clarification.

@ZeroQI ZeroQI added the enhancement New feature or request label Jun 6, 2021
@ZeroQI
Copy link
Owner

ZeroQI commented Jun 6, 2021

I have never tested the audio part nor used Plex for music...
if there is a relative path composed of two or more folders, it would make sense to put the artist pic in the parent one
https://github.com/ZeroQI/Lambda.bundle/blob/master/Contents/DefaultPrefs.json

  • line 15 field "artist_poster"

https://github.com/ZeroQI/Lambda.bundle/blob/master/Contents/Code/__init__.py lines 610-646 for music part

  • 599-601 artist_poster from
            if Prefs['artist_poster'] and directory.get('parentThumb') not in ('', directory.get('thumb')):  
              Log.Info('parentThumb:                 {}'.format(directory.get('parentThumb')))
              SaveFile(PMS+directory.get('thumb' ), os.path.join(path, 'artist-poster.jpg'), 'poster')

to:

            if Prefs['artist_poster'] and directory.get('parentThumb') not in ('', directory.get('thumb')):  
              Log.Info('parentThumb:                 {}'.format(directory.get('parentThumb')))
              SaveFile(PMS+directory.get('thumb' ), os.path.join(root, os.path.dirname(rel_path), 'artist-poster.jpg') if os.sep in rel_path else os.path.join(path, 'artist-poster.jpg'), 'poster')
  • 631-632 artist_poster from:
              if track.get('grandparentThumb') not in ('', track.get('parentThumb')):  SaveFile(track.get('grandparentThumb'), path, 'artist_poster')
              else:                                                                    Log.Info('[!] artist_poster not present or same as album')

to:

              if track.get('grandparentThumb') not in ('', track.get('parentThumb')):  SaveFile(track.get('grandparentThumb'), os.path.join(root, os.path.dirname(rel_path), 'artist-poster.jpg') if os.sep in rel_path else path, 'artist_poster')
              else:                                                                    Log.Info('[!] artist_poster not present or same as album')

Please test and report

@ZeroQI ZeroQI self-assigned this Jun 6, 2021
@jazzsnobeatcake
Copy link
Author

jazzsnobeatcake commented Jun 7, 2021

Hey, thanks for the quick response. I edited line 599-601 and 631-632 in Code/init.py but haven't had any luck getting the export running. I doubt that it's the code changes you suggested, I had trouble getting the regular release to run too. I'll try again, probably not before wednesday though (work obligations).

Can you give me the official rundown on how to get this started?
I definetly had it running once, when Lambda exported the artist poster to my album folders.
I currently have Lambda enabled under Agents/Albums/Last.fm and set it to ignore everything except artist_poster (set to folder.ext), collection folder set to root and metadata source set to plex. Hitting refresh all metadata on my music library should trigger the export process, correct?

@ZeroQI ZeroQI removed their assignment May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants