dirtyracer1337 / jellyfin.plugin.stash Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
My Library in Jellyfin is set up as Series/TV-Shows, instead of Movies, for sorting purposes.
It would be nice if Stash would show up as a Metadataprovider there as well.
Thanks ♥
I've noticed that metadata fetching seems to silently fail if a given scene name matches more than one file (for example, I have two files in stash named movie.2024.03.18.mp4
, but in different folders).
I think this is due to the following logic:
Jellyfin.Plugin.Stash/Jellyfin.Plugin.Stash/Providers/StashAPI.cs
Lines 103 to 108 in a9fc5bd
The above seems unintentional, especially given that the block immediately after iterates over the list and adds them to the result:
Jellyfin.Plugin.Stash/Jellyfin.Plugin.Stash/Providers/StashAPI.cs
Lines 110 to 121 in a9fc5bd
I think the correct condition should be:
if (!searchResults.Count) return result;
As a side note, the first part of this conditon:
if (!string.IsNullOrEmpty(path))
is not relevant to the logic being modelled, and is redundant given that the check is already made above
Jellyfin.Plugin.Stash/Jellyfin.Plugin.Stash/Providers/StashAPI.cs
Lines 72 to 80 in a9fc5bd
Pulling Coverart, Actor photos or any other images is currently broken.
All other textbased metadata is getting through without issue.
Interestingly, when trying to manually identify and match a scene, often (but not always) the correct image is being previewed in the list of matches but then not getting pulled.
In order to verify that this was not just a fluke I tried setting up multiple libararies on my main dockerized emby instance, tried it on a clean install fresh dockerized instance, and a windows10 based server install.
I have installed these plugin on jellyfin (Ver 10.8.13). I have added Stash API Key and Endpoint .But unable to get any metadata.
How do I add this to the Jellyfin server? I have tried adding it manually and it doesn't working. Adding the URL to the plugin list doesn't help either.
Does this plugin also work with StashDB.org?
When scraper an item, it doesn't work.
Here is the log:
[ERR] Error GetDataFromAPI "$Internal system error. Error <runtime error: invalid memory address or nil pointer dereference>"
version: jellyfin 10.9.3 archlinux
use the latest build from github action
Upd: the deployment build also not work as same as above
Upd: Solved. Stash has been updated and then solved.
Will there be a version of this that works with Emby?
Getting this error in Jellyfin logs when trying to pull the metadata from stashapp
Error Message
[00:49:51] [ERR] [105] Stash.Plugin: Error GetDataFromAPI "$Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Stash.Providers.StashAPI.GetDataFromAPI(String query, CancellationToken cancellationToken)"
Path naming convention
{Site TitleSlug} - {Release-Date} - {Episode Title} [{Quality.Title}]/{Site.TitleSlug}.{Release-Date}.{PerformersFemale}.{Episode.Title}.{Quality.Title}
Example
Site- 2022-09-18 - Title [WEBDL-2160p]\Site.2022-09-18.Firstname.Lastname.Title.WEBDL-2160p.mp4
Related: #19
The following is a very common deployment:
In this scenario, the stash API has the unique advantage that there's absolutely no need to guess in order to find an exact match for a given scene in jellyfin.
Either by configuration, or by default, when searching for a scene, use the entire path (incuding extension) in an exact search.
If needed, can allow for mapping of jellyfin -> stash paths, to address cases where the file system is under a different mountpoint between the services.
INCLUDE
modifier in the search query so any item in stash with a matching basename will be matchedJellyfin.Plugin.Stash/Jellyfin.Plugin.Stash/Providers/StashAPI.cs
Lines 72 to 92 in a9fc5bd
This has the following issues:
/media/Gape Queens (2017) WEB-DL 540p SPLIT SCENES MP4-KLEENEX/1 Adriana Chechik.mp4
1 Adriana Chechik
Both cases would cause the problem described in #19 to occur
In the current implementation, the following query is constructed:
https://my-stash-instance/graphql?query=query{findScenes(scene_filter%3A{path%3A{value%3A"\"HussiePass.20.09.04.Mz.Dani.\""%2Cmodifier%3AINCLUDES}}){scenes{id%2Ctitle%2Cdate%2Cpaths{screenshot}movies{movie{front_image_path}}}}}
An unescaped / prettified version of this:
take note of the INCLUDES
modifier
findScenes(
scene_filter: {path: {
value: "HussiePass.20.09.04.Mz.Dani.",
modifier: INCLUDES}}
) {
scenes {
id
title
date
paths {
screenshot
}
movies {
movie {
front_image_path
}
}
}
}
This gives the following result (with some fields redacted for brevity & anonymity)
{
"data": {
"findScenes": {
"scenes": [
{
"id": "7899",
"title": "54 Inch PAWG vs 13 Inch Cock",
"date": "2020-09-04"
},
{
"id": "7900",
"title": "54 Inch PAWG vs 13 Inch Cock",
"date": "2020-09-04"
},
{
"id": "7901",
"title": "54 Inch PAWG vs 13 Inch Cock",
"date": "2020-09-04"
}
]
}
}
}
For example, I can copy the following from jellyfin's Media Info panel:
and run the following graphql query from https://my-stash-instance/playground
:
take note of the EQUALS
modifier
{
findScenes(
scene_filter: {
path: {
value: "/data/cool_storage/qBittorrent/Complete/xxx_video/HussiePass.20.09.04.Mz.Dani.54.Inch.PAWG.vs.13.Inch.BBC..480p.MP4-XXX/HussiePass.20.09.04.Mz.Dani..mp4",
modifier: EQUALS}}
) {
scenes {
id
title
}
}
}
And the following result is returned:
{
"data": {
"findScenes": {
"scenes": [
{
"id": "7901",
"title": "54 Inch PAWG vs 13 Inch Cock"
}
]
}
}
}
To demonstrate these side-by-side:
{
findScenesExact: findScenes(
scene_filter: {path: {
value: "/data/cool_storage/qBittorrent/Complete/xxx_video/HussiePass.20.09.04.Mz.Dani.54.Inch.PAWG.vs.13.Inch.BBC..480p.MP4-XXX/HussiePass.20.09.04.Mz.Dani..mp4",
modifier: EQUALS}}
) {
scenes {
id
title
}
}
findScenesInclude: findScenes(
scene_filter: {path: {
value: "HussiePass.20.09.04.Mz.Dani.",
modifier: INCLUDES}}
) {
scenes {
id
title
date
}
}
}
{
"data": {
"findScenesExact": {
"scenes": [
{
"id": "7901",
"title": "54 Inch PAWG vs 13 Inch Cock"
}
]
},
"findScenesInclude": {
"scenes": [
{
"id": "7899",
"title": "54 Inch PAWG vs 13 Inch Cock",
"date": "2020-09-04"
},
{
"id": "7900",
"title": "54 Inch PAWG vs 13 Inch Cock",
"date": "2020-09-04"
},
{
"id": "7901",
"title": "54 Inch PAWG vs 13 Inch Cock",
"date": "2020-09-04"
}
]
}
}
}
In the "exact" case we see one result, in the "include" case we see 3 results.
For some containerized deployments, the mapping of the filesystem may not be identical between stash and jellyfin
This scenario is not unique to stash / jellyfin, and is well-documented in similar media apps, for example, sonarr:
https://trash-guides.info/Sonarr/Sonarr-remote-path-mapping/
To address this, we could add a configuration option for mapping these paths, some apps support this, I myself have implemented similar in my own script for transferring torrents across systems: https://github.com/C84186/qBittorrent_tag_by_pattern/blob/main/paths.py#L60
That being said, I think it's reasonable to make exact matching a configuration option, and then put the onus on the user to ensure their filesystem paths match up (it's not that hard)
First of all: I LOVE this Plugin. I contributed an scraper for Stash that gets the Metadata from Jellyfin and always wanted to have this the other way round as well (but can't write C# Code). Your Plugin is exactly what I was looking for, thanks so much!
I have two enhancement requests:
All my full length movies have an FrontCover in Stash in the Movie Category. It would be great if this could be used instead of the Screenshot from the Scene (as far as it exists). It is part of the Graphql resultSet for the Scene:
movies {
movie {
front_image_path
}
}
It would be great if the Plugin could get the Director of the movies (right now "only" the actors are added
I would love to do this as an pull request, but I am really not skilled enough in C# to understand how to correctly deal with the results from the queries unfortunately.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.