Jump to content

Make folder-recognizing a little less smart


anderbytes

Recommended Posts

Happy2Play

Not sure where your issue is, but here is exactly what I did with metadata not saved with media.

 

Server wasn't running

created 1983 folder in movies library

created Star Wars, Episode VI - Return of the Jedi (1983) folder

put media in folder Star Wars, Episode VI - Return of the Jedi (1983).disc

started server launched library scan.

 

56be995d25ab3_test.jpg

 

Note testing on dev release, but shouldn't make a difference.

Edited by Happy2Play
Link to comment
Share on other sites

Koleckai Silvestri

1983 is a movie... https://www.themoviedb.org/movie/253535-1983

 

Is there any media file in that directory? Or are they all in Sub-directories.

 

Try naming that one folder year_1983 and refreshing it in the Metadata Editor. See if it works then.

 

I would suspect your naming scheme is triggering false positives. I don't have that problem. My movies are in the folders movies_1, movies_2, movies_3, animation\disney, animation\anime, animation\dreamworks, animation\other. In the other folder, there are a dozen other studios listed in sub-forums.

 

You can sort your movies by year in the web client by choosing timeline.

Edited by Koleckai Silvestri
Link to comment
Share on other sites

anderbytes

@Happy2

 

Not sure where your issue is, but here is exactly what I did with metadata not saved with media.

 

Server wasn't running

created 1983 folder in movies library

created Star Wars, Episode VI - Return of the Jedi (1983) folder

put media in folder Star Wars, Episode VI - Return of the Jedi (1983).disc

started server launched library scan.

 

56be995d25ab3_test.jpg

 

@@Happy2Play and @@Luke , I guess I found the root of the problem.

 

In EVERY year folder that had ONLY one movie... he used the YEAR FOLDER string to search for metadata and put inside the movie.

 

In EVERY year folder that had MORE than one movie in that year, he ignored the YEAR and searched correctly by each sub-folder inside year.

 

Can you understand my explanation above?

 

As SW Episode VI is the only movie inside 1983... he used 1983 to look for metadata...

If I put another movie inside 1983... he will use the sub-folder name (the correct way) to look for metadata, not the year folder name.

Link to comment
Share on other sites

anderbytes

1983 is a movie... https://www.themoviedb.org/movie/253535-1983

 

Is there any media file in that directory? Or are they all in Sub-directories.

 

Try naming that one folder year_1983 and refreshing it in the Metadata Editor. See if it works then.

 

I would suspect your naming scheme is triggering false positives. I don't have that problem. My movies are in the folders movies_1, movies_2, movies_3, animation\disney, animation\anime, animation\dreamworks, animation\other. In the other folder, there are a dozen other studios listed in sub-forums.

 

You can sort your movies by year in the web client by choosing timeline.

 

Koleckai,

 

there's no media inside 1983... only a subfolder of a movie, and then inside that the media.

Link to comment
Share on other sites

anderbytes

Not sure where your issue is, but here is exactly what I did with metadata not saved with media.

 

Server wasn't running

created 1983 folder in movies library

created Star Wars, Episode VI - Return of the Jedi (1983) folder

put media in folder Star Wars, Episode VI - Return of the Jedi (1983).disc

started server launched library scan.

 

 

Note testing on dev release, but shouldn't make a difference.

 

I believe as my metadata is set to be downloaded in Portuguese, we aren't falling into the same metadata.

I guess one more time... outside US user is screwed...

Link to comment
Share on other sites

Happy2Play

I only have one movie folder in 1983 as shown in screenshot.  Are you making these libraries while the server is running?  If so that could be the problem.  Auto scan would be seeing the folders as they are being created and trying to get metadata before you are finished.

 

I will set my Emby global language to Portuguese and add another year folder and 1 movie folder.

Link to comment
Share on other sites

anderbytes

I only have one movie folder in 1983 as shown in screenshot.  Are you making these libraries while the server is running?  If so that could be the problem.  Auto scan would be seeing the folders as they are being created and trying to get metadata before you are finished.

 

I will set my Emby global language to Portuguese and add another year folder and 1 movie folder.

 

I will try but... do you say I have to stop Emby every time I create a new year folder?

Will do this and respond in a moment

Link to comment
Share on other sites

anderbytes

I only have one movie folder in 1983 as shown in screenshot.  Are you making these libraries while the server is running?  If so that could be the problem.  Auto scan would be seeing the folders as they are being created and trying to get metadata before you are finished.

 

I will set my Emby global language to Portuguese and add another year folder and 1 movie folder.

 

Didnt work... but I guess I know why.

The movie from 1983 that I manually corrected is still corrected.

 

I guess that there's some Emby XML being considered instead of being erased in refreshes.

 

How can I completely erase all metadata?

I guess I'll just delete metadata folder...

Link to comment
Share on other sites

Happy2Play

Here is what I got adding 1999 and star wars episode I using periods with Portuguese (Brazil).

 

56bea0344d87a_test.jpg

Link to comment
Share on other sites

Happy2Play

Didnt work... but I guess I know why.

The movie from 1983 that I manually corrected is still corrected.

 

I guess that there's some Emby XML being considered instead of being erased in refreshes.

 

How can I completely erase all metadata?

I guess I'll just delete metadata folder...

Not sure where nfo/xml data is saved when not saving with media, I know the images are saved in metadata\library in the item id folder you can see the itemid in the browser when you are on a movie.

Edited by Happy2Play
Link to comment
Share on other sites

anderbytes

Here is what I got adding 1999 and star wars episode I using periods with Portuguese (Brazil).

 

 

 

@@Happy2Play , no deal. Nothing works. Not even deleting the metadata folders I knew.

 

The more interesting is the movie I adjusted manually continues adjusted   :-O

 

I give up... I'll have to rollback and put everything in just one folder.

 

If at least Emby could behave like in the cases were there are more than 1 movie inside the year folder...

Link to comment
Share on other sites

If at least Emby could behave like in the cases were there are more than 1 movie inside the year folder...

 

can you give an example?

Link to comment
Share on other sites

anderbytes

can you give an example?

 

Well...let's go...

 

I already worked with programming... will be a bit more technical below.

 

In the case I reported, in YEAR FOLDER's (Ex: 1983, 1999, etc...) that has MORE than 1 sub-folder (it has 2 or more movies inside) Emby ignores the YEAR FOLDER as a input for metadata search. Somehow he knows that if there are more than 1 subfolder in there... EACH OF THEM must be a separate movie.

 

Differently.... when Emby notices that the YEAR FOLDER has only 1 subfolder (case of my 1983), he considers that YEAR FOLDER and the 1 subfolder inside contain files of a same movie, and decides that he doesnt need the subfolder as input to search for metadata.

 

So.. the strange is: in the moment Emby dives recursively into folders... why does he acts differently when he sees =1  or  >1  subfolders below ?

 

To confirm my theory, I put a movie that he hasn`t recognized from 1993 (it was alone there, too) inside 1983 folder... and right after he recognized it correctly, thing that hasnt happened when the 1993 movie was alone inside 1993 folder

Edited by anderbytes
Link to comment
Share on other sites

anderbytes

Another way to explain:

 

/MOUNTPOINT / VIDEOS_FOLDER / 1983 / MOVIE_FOLDER_1 / MOVIE_FILE_1.MKV   --> Uses "1983" to search for metadata

/MOUNTPOINT / VIDEOS_FOLDER / 1994 / MOVIE_FOLDER_2 / MOVIE_FILE_2.MKV   --> Uses "Movie Folder 2" to search for metadata

/MOUNTPOINT / VIDEOS_FOLDER / 1994 / MOVIE_FOLDER_3 / MOVIE_FILE_3.MKV   --> Uses "Movie Folder 3" to search for metadata

Link to comment
Share on other sites

Happy2Play

I don't know why OS would make a difference, but I can't replicate this on Windows.   Using 3.05821.0 or 3.05886.37598

Link to comment
Share on other sites

anderbytes

I don't know why OS would make a difference, but I can't replicate this on Windows.   Using 3.05821.0 or 3.05886.37598

 

As the server isn't written in Java (thank god!), specific rules applies to each O.S.

 

Permissions are different, filesystem are different, folder referencing ( C:\  versus  /  ) , etc...etc...etc...etc...

So yes, from my experience, it is possible that some stuff works in one, and not in another.

 

Have to go sleep now. It's 2 AM here. Continue this later....

Edited by anderbytes
Link to comment
Share on other sites

anderbytes

What content type did you make your movie library

Movies. That one that gets all the good stuff...

Link to comment
Share on other sites

Happy2Play

That is what I initially thought was maybe content type, but couldn't replicate the issue with mixed content either.

Link to comment
Share on other sites

anderbytes

That is what I initially thought was maybe content type, but couldn't replicate the issue with mixed content either.

I wish there were more Linux users that could help me reproduce it.

 

Did you understand my last explanations and examples? It's so weird.

 

If nothing is done by the devs, I'll be forced to :

1. Keep everything in one folder, or

2. Create a library for each year

Link to comment
Share on other sites

anderbytes

@@Luke, can you point my at which file and code (in GitHub) is the place where Emby goes recursively in folders fetching Metadata?

 

I'd like to take a look at it.

 

Thanks

Link to comment
Share on other sites

Happy2Play

I wish there were more Linux users that could help me reproduce it.

 

Did you understand my last explanations and examples? It's so weird.

 

If nothing is done by the devs, I'll be forced to :

1. Keep everything in one folder, or

2. Create a library for each year

Don't know how many Linux users check the Windows/General forum so you may want to ask in the Linux forum and reference this topic.

Link to comment
Share on other sites

anderbytes

Don't know how many Linux users check the Windows/General forum so you may want to ask in the Linux forum and reference this topic.

Good idea. Will try.

I consider this one as the "default" forum for server issues, dunno why...

Link to comment
Share on other sites

anderbytes

@@Luke, is that the C# code that scans, correct?

https://github.com/MediaBrowser/Emby/blob/master/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs

 

Reading the code, I have some questions and a theory.

 

Questions:

- What is the difference between LeftOver and video files?

- Can you tell me how does that line works? --> if ((child.Attributes & FileAttributes.Directory) == FileAttributes.Directory)

 

Theory: seeing the code below, I suspect that folders whose subfolders count == 1 may be inserted in the "result" array as if they were video files to be searched for Metadata later.

 

Below, anything in result that has 1 item inside is considered a movie... (maybe even the YEAR FOLDER ?)

if (result.Items.Count == 1)
            {
                var movie = (T)result.Items[0];
                movie.IsInMixedFolder = false;
                movie.Name = Path.GetFileName(movie.ContainingFolderPath);
                return movie;
            }
Is it possible to insert a debug log every time you "recognize" a movie and search for its metadata?

This way... we'll be able to understand exactly what are the search parameters and trace/debug what is happening.

 

 

UPDATE: actually , it's a little more strange than that. He doesn't think the FOLDER is a video. I just remembered he only behaves differently with the video inside when the folder is alone on its parent. The proof of that is that in the metadata editor, he gets right the FILENAME (only field that is correct, to tell the truth)

 

Will keep digging...

Edited by anderbytes
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...