Jump to content

Theme Music fails when media directory name does not match .mp4 file


Go to solution Solved by roaku,

Recommended Posts

visproduction
Posted (edited)

I ran into this glitch in the .js code when I manually changed the media file names, so they no longer matched the folder name.  When I did that, audio files in the theme-music directory fail to play.

With missmatched name: console.log shows 
viewmanager.js?v=4.7.6.0.1

viewManager.onBeforeChange - processing path: isBack: undefined


Looking inside viewmanager.js, I noticed that isBack does not have

var isBack= 0; 

Just a guess, maybe that is part of the problem?  Variable undefined, often comes from no variable declaration and the name mismatch stops isBack from getting declared, so maybe isBack is out of scope. Media playback is fine, but this file name change seems to kill the theme-music. 

The reason to edit the media title comes from another code issue:
If you have an extra - in the media title, it seems to cause problems with recognizing that there are two versions of media resolution.  For Example: Media-title - 720P.mp4 and Media-title - 1080P.mp4 stops drop down choice from being  just '1080P' and '720P'.  If the user fixes that by removing the first dash, then theme-music fails.

I fixed theme-music by renaming the media folder to be the same as the media file before the dash, infront of the video size,  ('-720P').

Theme music fails with isBack error
 Folder Name/Changed Media Name-720P.mp4

 Folder Name/Changed Media Name-1080P.mp4


Theme music works with matched folder and media names
 Folder Name/Folder Name -720P.mp4

 Folder Name/Folder Name -1080P.mp4

This is the sort of glitch that you would hardly ever notice and leaving file names alone seems to avoid this.  So, perhaps not bothering to fix, is correct.  I don't like authoring code that can cause out of scope, undefined errors, when a user makes a file name update.  Anyway, thought you would like to know, even as a troubleshoot solution.

Edited by visproduction
Posted

Hi, can you please provide a specific example of the folder name and show the complete folder contents? Thanks.

visproduction
Posted

Theme-music fails

Folder: John Smith War and Peace (1949) 
 Media file name:  John Smith - War and Peace (1949) - 1080P
(Extra dash after John Smith)

Sub folder: theme-music:
 Media File name: Music from War and Peace.mp3

===
 

Theme-music works:

Just change media file name to match foloder name with no extra dash after John Smith: 

Folder: John Smith War and Peace (1949) 
 Media file name:  John Smith War and Peace (1949) - 1080P

Sub folder: theme-music
Nothing is changed, the file name is the same: Music from War and Peace.mp3


You have to manually change the media file name to cause this error.  If you let Ebmy pull from the media name, I think it works.  If you have two dashes in a name, then the pull down choices are no longer just 720P and 1080P.  That is what caused me to edit the file names.  Only Media name - 1080P and Media name - 720P results in seeing only 1080P and 720P in the pull down selection on the media page.  Obviously this is an edge case and probably can be ignored.




 

Posted
Quote

and show the complete folder contents? Thanks.

 

visproduction
Posted

theme-music needs folder and media file names to be the same except for resolution size after the dash.jpg

Happy2Play
Posted
4 hours ago, Luke said:

@Happy2Play are you able to reproduce?

Little confused here as this change breaks multi-versioning.  But yes breaking multi-versioning cause Theme to stop working for the items that now show separately.  Manually grouping them does not correct the issue.

 

visproduction
Posted

It continues to happen multiple times, whenever the folder name does not match the media content file name before the dash. Try just changing the main media name in a folder so it no longer matches the folder name and see if the theme-music fails to play.

  • 4 weeks later...
Posted

Are you still having an issue with this?

Happy2Play
Posted
On 9/1/2022 at 8:08 PM, visproduction said:

It continues to happen multiple times, whenever the folder name does not match the media content file name before the dash. Try just changing the main media name in a folder so it no longer matches the folder name and see if the theme-music fails to play.

But that is the Rule for Multi-versions so breaking that rule breaks the folder.

  • Each version must begin with the folder name, followed by " - ".

So the question here is do you have the same issue on an item without multi-versioning?

 

visproduction
Posted

I understand the rules and I can get theme-music to work.  I just wanted to point out that when you have media content with 2 dashes in the name, for example, music-theme subdirectory audio stops and will not play.  Was that mentioned anywhere in the instructions for theme-music?

Posted
32 minutes ago, visproduction said:

I understand the rules and I can get theme-music to work.  I just wanted to point out that when you have media content with 2 dashes in the name, for example, music-theme subdirectory audio stops and will not play.  Was that mentioned anywhere in the instructions for theme-music?

@Happy2Play are you able to reproduce?

Happy2Play
Posted
2 minutes ago, Luke said:
34 minutes ago, visproduction said:

I understand the rules and I can get theme-music to work.  I just wanted to point out that when you have media content with 2 dashes in the name, for example, music-theme subdirectory audio stops and will not play.  Was that mentioned anywhere in the instructions for theme-music?

@Happy2Play are you able to reproduce?

From a non multi-version no. 

Works as not versioned so name does not have to match

image.png.32e134985ca4f110e82764850621e512.png

From multi-version yes as it breaks the rules.

Fails

image.png.a8920d849cee21cfbf8793e7a1931d3b.png

On 8/22/2022 at 12:41 PM, visproduction said:

Theme music fails with isBack error
 Folder Name/Changed Media Name-720P.mp4

 Folder Name/Changed Media Name-1080P.mp4


Theme music works with matched folder and media names
 Folder Name/Folder Name -720P.mp4

 Folder Name/Folder Name -1080P.mp4

Expected behavior do to breaking the rules.  Automatic grouping technically broken and will present separate items, but with plugin item is grouped and still broken.

Am I misunderstanding here?

Happy2Play
Posted

Now correcting the mismatch works fine as Folder and File MUST match.

image.png.7858f7b3debf1f5118c591c52751566f.png

visproduction
Posted (edited)

Your examples work.  Those are not the examples that break Theme-music.  A user could rename a folder or media file name for some reason and if they no longer match, theme-music stops.  I admit it can be rare, but it is still a bug.
 

Theme-music playback depends on folder name matching media content file names.jpg

Edited by visproduction
  • Solution
Posted
5 minutes ago, visproduction said:

Your examples work.  Those are not the examples that break Theme-music.  A user could rename a folder or media file name for some reason and if they no longer match, theme-music stops.  I admit it can be rare, but it is still a bug.
 

Theme-music playback depends on folder name matching media content file names.jpg

You are triggering multi-version mode based on your filenames.

This *requires* that the filename before the '-' match the directory name.

When you fail to meet this requirement, you break things.

This isn't a bug.

  • Thanks 1
visproduction
Posted

Aha, OK. Thanks.  

This sounds like this breaks anytime a user adds a new resolution. It would be nice to explain how you fix it so theme-music works again.  I have not seen a FAQ how to fix theme-music for multi-version content. 

Posted (edited)
7 minutes ago, visproduction said:

Aha, OK. Thanks.  

This sounds like this breaks anytime a user adds a new resolution. It would be nice to explain how you fix it so theme-music works again.  I have not seen a FAQ how to fix theme-music for multi-version content. 

It won't break anything as long as the new file is named properly (matches the existing directory name before the multi-version dash).

Adding a new file that *doesn't* match the directory name causes Emby to stop seeing the parent folder as a container for the item. It becomes a 'dumb' folder that hosts multiple, unrelated items. That's why you start seeing '[item]-poster.jpg' per movie file instead of just one 'poster.jpg' for the entire folder.

The 'theme-music' folder is associated with the 'smart', multiversion parent folder. When the parent directory is 'dumb', the theme-music folder becomes 'dumb' too.

 

Edit: And I'm just speaking from personal experience using this feature. Devs/testers/etc. are welcome to correct any of my inferences.

Edited by roaku
  • Agree 1

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...