stashapp / stash

An organizer for your porn, written in Go. Documentation: https://docs.stashapp.cc
https://stashapp.cc/
GNU Affero General Public License v3.0
8.71k stars 774 forks source link

Transfer metadata between galleries and scenes #2780

Open BlaM opened 2 years ago

BlaM commented 2 years ago

Is your feature request related to a problem? Please describe. Usually - if there are galleries and scenes linked together - they will have the same metadata. There is no easy way to "link" or at least copy the metadata - especially the tags - between scenes and galleries, though.

Describe the solution you'd like For this special case where the two items are technically already linked via the "This gallery belongs to this scene" functionality a simple "Fetch Metadata from linked item" would be enough.

Describe alternatives you've considered Another solution is suggested in feature request #2759 - copy the data via "export" / "import".

Another option: Don't look at linked galleries/scenes but allow the import/scraping of other items that use the same URL by copying the metadata from there.

Another option: Allow the user to fully link both items and as soon as the metadata for one of both items is changed, also change the other.

Additional context

sleetx commented 2 years ago

This is related to #2165 - it should be an automatic process, in my opinion

The current workaround is to link the scene to the gallery, save, then manually run a community scraper "CopyFromScene", then save again.

cj12312021 commented 2 years ago

If you have the gallery in the same directory as the scene, the CopyToGallery scrapper will find the gallery(s) automatically and then copy over the data in one scan. Since CopyToGallery is a scene scrapper, you can use the identify task and run it against a bulk of scenes.

citrixscu commented 2 years ago

If you have the gallery in the same directory as the scene, the CopyToGallery scrapper will find the gallery(s) automatically and then copy over the data in one scan. Since CopyToGallery is a scene scrapper, you can use the identify task and run it against a bulk of scenes.

Is this feature currently working as intended? When setting find_gallery = True in CopyToGallery.py and a gallery exists in the same directory, for example, gallery.zip, the Identify task errors with: could not unmarshal json from script output: EOF.

Log exists below:


ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery]   File "/home/username/.stash/scrapers/CopyToGallery.py", line 105, in <module>
ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery]     gallery_ids = find_galleries(SCENE_ID, scene["path"])
ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery]   File "/home/username/.stash/scrapers/CopyToGallery.py", line 68, in find_galleries
ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery]     id = get_gallery_id_by_path(gallery_path)
ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery]   File "/home/username/.stash/scrapers/CopyToGallery.py", line 32, in get_gallery_id_by_path
ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery]     return result['findGalleries']['galleries'][0]['id']
ERRO[2022-08-18 20:45:46] [Scrape / Copy to Gallery] TypeError: 'NoneType' object is not subscriptable
ERRO[2022-08-18 20:45:46] could not unmarshal json from script output: EOF```
BlaM commented 2 years ago

Same for me, but I don't think that this is the correct thread/ticket/project for THAT bug -> https://github.com/stashapp/CommunityScrapers/issues