Jump to content

[Bug] BaseItem.ContainingFolderPath does not return the correct value


Ribesg

Recommended Posts

Ribesg

Hi,

As discovered after some investigation here, when the Title of a show does not match its folder name (the folder containing subfolders named Season 1, etc.), the the value BaseItem.ContainingFolderPath is incorrect and does not contain the full path but only (it seems) the show's folder name itself.

This is a big issue as the title is often translated, while it is a better idea to use the original show name as the folder name so that Emby recognize it correctly when matching against TheTVDB etc. Sometimes I even have to put the show date in the folder name for it to be recognized correctly, which I don't want to appear in the displayed title. I'm saying this to explain that the displayed title of a show should not have to match it's containing folder name.

Anyway, for whatever reason a property called ContainingFolderPath does not contain the containing folder path, and that's the bug I'm reporting here.

Thanks

Link to comment
Share on other sites

Ribesg

So I base my report on what I know, it prevents the Iconic Image Enhancer plugin from correctly checking against containing folders on item, preventing icons from appearing. The developer refused to report the issue themselves, not sure why.

Here is a show that isn't displaying icons it should display because it doesn't match a filter on the containing folder being named "series". Apparently, BaseItem.ContainingFolderPath returns "Designated Survivor" and not "/home/emby/series/Designated Survivor" here.

image.thumb.png.5744f3f882d6098d0305785d9ea00a44.png

If I replace "Survivant désigné" with "Designated Surviror" and save, the icons appear.

That's how I understand the issue but maybe @roaku can be more precise.

Link to comment
Share on other sites

roaku

@Luke

My understanding of the user's issue is that their episode filenames don't match their series directory folder name ('Raised by Wolves (2020)' versus 'Raised by wolves.ext'). They have variations in capitalization, spaces, etc.

In these cases, Emby doesn't match the parent series directory with the episode files because of these differences and instead treats the episode files as if they're in a root library directory.

As a consequence, BaseItem.ContainingFolderPath, which my plugin depends on to check the full folder path of an item, only returns the immediate parent folder, instead of the true full path on the host system ('[full path]/series/Raised by Wolves (2020)' versus 'Raised by Wolves (2020)').

I advised the user to match his file names to his folder names. When they said they weren't going to do that, I advised them to open a *feature request* for Emby to support looser file name/folder matching.

 

 

Edited by roaku
Link to comment
Share on other sites

The file names don't need to match the series folder name, so he should open a topic in the general section of the community and provide details of a specific example.

Link to comment
Share on other sites

Ribesg

I still don't understand why we're talking about file names. The issue is on shows and I provided an example with a workaround which didn't involve any file name, only folder name and metadata.

Link to comment
Share on other sites

19 minutes ago, Ribesg said:

I still don't understand why we're talking about file names. The issue is on shows and I provided an example with a workaround which didn't involve any file name, only folder name and metadata.

HI, we're happy to help. If you believe you have an issue in the core Emby Server, then please open a topic in the general section of the community and describe your issue in detail. Thanks.

Link to comment
Share on other sites

Ribesg

That's what I did. Looks like my post got moved here. I guess you can move it back if you want.

I don't think I have more information than provided

Link to comment
Share on other sites

This topic is in the developer api section and the title of the topic is zeroing in on what you think the fix is and not what the original problem actually is.

Can you please edit the first post to update the thread title and description to reflect the underlying problem? Thanks.

Link to comment
Share on other sites

Ribesg

My issue is that the folder filter of the Iconic Image Enhancer plugin doesn't work because of a bug in Emby.

If I explain my problem from the user pov you'll just tell me that I should report it to @roaku or that they should report it in the section my post was moved to. They already refused to report it.

I'll reiterate that I have no folder/file naming issue on my end. My first answer to this topic has an example. Just have the plugin configured to add an icon on the show if it's in its library folder, the icon will only appear if the translated title matches the folder name. You can edit the metadata easily, the icon appears/disappears immediately on save.

Link to comment
Share on other sites

OK please describe your issue and then we'll see what it pertains to. Thanks.

Link to comment
Share on other sites

Ribesg

I don't understand what you mean. I described it multiple times in different ways in this topic. Can you be more specific on what information you're missing?

Link to comment
Share on other sites

3 hours ago, Ribesg said:

I don't understand what you mean. I described it multiple times in different ways in this topic. Can you be more specific on what information you're missing?

You opened a topic here about BaseItem.ContainingFolderPath telling me what you think the fix is but without stating what the actual problem is. What issue are you having with the core server? it doesn't sound like you're having one.

Link to comment
Share on other sites

On 6/23/2022 at 5:48 AM, Ribesg said:

So I base my report on what I know, it prevents the Iconic Image Enhancer plugin from correctly checking against containing folders on item, preventing icons from appearing. The developer refused to report the issue themselves, not sure why.

Here is a show that isn't displaying icons it should display because it doesn't match a filter on the containing folder being named "series". Apparently, BaseItem.ContainingFolderPath returns "Designated Survivor" and not "/home/emby/series/Designated Survivor" here.

image.thumb.png.5744f3f882d6098d0305785d9ea00a44.png

If I replace "Survivant désigné" with "Designated Surviror" and save, the icons appear.

That's how I understand the issue but maybe @roaku can be more precise.

ContainingFolderPath will return the parent folder path of a video, or the path itself if you're calling it on something that is a folder.

Link to comment
Share on other sites

roaku
13 minutes ago, Luke said:

ContainingFolderPath will return the parent folder path of a video, or the path itself if you're calling it on something that is a folder.

When the user's conditions as described above are met, ContainingFolderPath returns only 'Designated Survivor' instead of '/home/emby/series/Designated Survivor'.

My plugin is trying to check if any of the parent folder names in the path match a particular user provided name.

It can't do this in this case where ContainingFolderPath only returns the immediate folder parent instead of the true full folder path of the item.

If nothing is wrong with Emby core, is there an alternative property or method I can check that will always return the full path of the item ('home/emby/series/Designated Survivor') versus the abbreviated path that is being returned in the user's described case ('Designated Survivor')?

I directed the user to the Emby team because I don't have access to their system or Emby's code. I'm happy to update my plugin in any way to resolve the issue if that's possible.

Edited by roaku
Link to comment
Share on other sites

Ribesg

Right, that explains the problem partially. The unexplained behavior would be why renaming the display title of the show to exactly the folder name makes it work. There may be something that changes from relative to absolute path for some reason?

I wonder if checking the path of a random episode of the show instead of the show itself would change anything.

Also, I realized I never said that while I never used either Emby's API nor the language of Emby's environment, I'm a developer myself and have a certain general understanding of things.

I agree that a more reliable way to get the full path of any kind of item would be useful, if the current uncertainty of if ContainingFolderPath is relative or absolute is not a bug.

Edited by Ribesg
Link to comment
Share on other sites

roaku
2 hours ago, mickle026 said:

Don't know if .Parent.Path; is usefull to you

 

 

Thanks. I'll take a look.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...