Kodi Community Forum

Full Version: Question about TV Show library and shows within bdmv folders
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

recently I started to archive my blu-ray disc collection. After completing my movies I was able to add these to the movie library.
I archive the whole blu-ray structure to preserve as much as possible of the original disc content, which results in the bdmv folder structure with subdirectories.
I had trouble with the "Scan Recursively" option and I had to disable it to get a flawless result.

I just started to archive the tv show boxes. In this case I have blu-ray discs cotaining more than one episode.
In the forum I found the suggestion to choose S01E01E02E03E04 as the naming scheme.

Now I have the following structure (folders are enclosed in "")
"TV Shows"
  |
  |->"TV-Show Name"
  |      |
  |      |->"Season1"
  |      |     |->"S01E01E02E03E04"
  |      |          |->"BDMV"
  |      |          |     |->"Auxdata"
  |      |          |     |->"..."
  |      |          |     |-index.bdmv
  |      |          |->"Certificate"
  |      |          ...
  |      |     |->"S01E05E06E07E08"
  |      |          |->"BDMV"
  |      |          ...
  |      |->Season2
  |      |->Season3

The problem is that after rescanning the video library i have 187 episodes. I expected much less episodes, refering to the example above it should be 8.
In the debug log I can see that ".../BDMV/BACKUP/PLAYLIST/00001.mpls" is added as episode 1 and so forth.

I want to achieve that I have all episodes listed correctly in the library view and if I play a episode, the right "Blu-Ray" disc actions is started (full menu, or short menu. Mainfeature make no sense here).
For me it is perfectly fine that I have to select the episode again from the following menus.

I have Kodi 19.0 running on a ubuntu system with mysql database connection.
There are no "scraping" related options set in the "advancedsettings.xml" file.

Thanks for your help.
Bjoern
Add this to your advancedstting.xml file...

xml:
<tvshowmatching action="append">
<regexp>[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(?Sad?:[\\/]bdmv)?[\\/]index\.bdmv)$</regexp>
</tvshowmatching>
(2021-03-17, 20:57)Karellen Wrote: [ -> ]Add this to your advancedstting.xml file...

xml:
<tvshowmatching action="append">
<regexp>[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(?Sad?:[\\/]bdmv)?[\\/]index\.bdmv)$</regexp>
</tvshowmatching>

Thanks for your reply.
I gave it a try yesterday, sadly it looks like that nothing has happened.
Perhabs I have to modify the regex a littlebit. Seems that it expects a "x" character between the season and the episode part.
Do you know if the regex engine is case sensitve? Because I will have to deal with this as well (no big problem).
I looked at https://kodi.wiki/view/RegEx_tutorial but I found nothing on this topic.

The Expression you gave me has three capture groups.
I think the first is for the season, the second is for the episode and the third is used for multipart episodes?

When the expression is matched, will the info scanner stop there (at index.bdmv) or will it dive deeper in the subfolders an detect the *.mpls files again?

Thanks
I made an observation. In your code block the regex looks like this:
[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(??:[\\/]bdmv)?[\\/]index\.bdmv)$
When I answered to your reply it looks like this:
[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(?Sad?:[\\/]bdmv)?[\\/]index\.bdmv)$

Is this a bug in the forum software?
(2021-03-18, 17:00)-=Rapidfire=- Wrote: [ -> ]I made an observation. In your code block the regex looks like this:
[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(??:[\\/]bdmv)?[\\/]index\.bdmv)$
When I answered to your reply it looks like this:
[\\/\._ \[\(-]([0-9]+)x([0-9]+)([^\\/]*)(?Sad?:[\\/]bdmv)?[\\/]index\.bdmv)$

Is this a bug in the forum software?
Sorry, the : and the ) where substitued with the icon.
(2021-03-18, 17:00)-=Rapidfire=- Wrote: [ -> ]Is this a bug in the forum software?
No. Above the Post Reply button, tick "Disable Smilies" for the post

Did you get the code work?
(2021-03-18, 20:42)Karellen Wrote: [ -> ]
(2021-03-18, 17:00)-=Rapidfire=- Wrote: [ -> ]Is this a bug in the forum software?
No. Above the Post Reply button, tick "Disable Smilies" for the post

Did you get the code work?

Hi, I think I was not exact enough about the odd representaion of your regex.
Please have a look at your string in the code block in post #2. The characters witch were substituted in my post are completly missing there. Copy paste has lead to errors in this case (missing colon and bracket).

Thanks for the hint for disabling smilies, this will come in handy while talking about regex.

Using your expression had no effect so I modified it to
<regexp>[\\/\._ \[\(-][sS]([0-9]+)[xXeE]([0-9]+)([^\\/]*)(?:(?:[\\/][bB][dD][mM][vV])?[\\/]index\.bdmv)$</regexp>
It is a bit bulky because I do not know how case sensitivnes is handled an I decided to be prepared for it.
I hope I understand the concept with the three capture groups. That's why I asked for it in my first response.

But sadly it does not work. I enabled logging to get a grip on that.

My observations so far:
1. The scanning process is iterating through the subfolders and matches a lot of stuff, which it should not in the case of a BDMV Folder. At least that is what I was expecting.
example from log:
VideoInfoScanner: Found episode match smb://...long_path.../TV-Show/Season1/S01E01E02E03E04/BDMV/BACKUP/PLAYLIST/00000.mpls (s0e0) [[\\/\._ -]([0-9]+)([0-9][0-9](?:(?:[a-i]|\.[1-9])(?![0-9]))?)([\._ -][^\\/]*)$]

2. The regex from the advancedsettings.xml are not used. Eventually other default expressions matching earlier?
example from log:
VideoInfoScanner: Found episode match smb://...long_path.../TV-Show/Season1/S01E01E02E03E04/BDMV/index.bdmv (s1e1) [s([0-9]+)[ ._x-]*e([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)([^\\/]*)$]
VideoInfoScanner: Adding multipart episode 2 [^[-_ex]+([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)]
VideoInfoScanner: Adding multipart episode 3 [^[-_ex]+([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)]
VideoInfoScanner: Adding multipart episode 4 [^[-_ex]+([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)]

3. Looking at the example from above, it seems that the multipart detection is working correctly on the index.bdmv file. A bit later I can find the following for the MovieObject.bdmv file
VideoInfoScanner: Found episode match smb://...long_path.../TV-Show/Season1/S01E01E02E03E04/BDMV/MovieObject.bdmv (s1e1) [s([0-9]+)[ ._x-]*e([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)([^\\/]*)$]
VideoInfoScanner: Adding multipart episode 2 [^[-_ex]+([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)]
VideoInfoScanner: Adding multipart episode 3 [^[-_ex]+([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)]
VideoInfoScanner: Adding multipart episode 4 [^[-_ex]+([0-9]+(?:(?:[a-i]|\.[1-9])(?![0-9]))?)]

4. In the actual tv-show library I can find two entrys per episode referring to this files MovieObject.bdmv and index.bdmv. Also there are the entrys which are caused by the behaviour I described at 1.

I've got the impression that the recursion could be the root cause of this problem.

Bjoern
(2021-03-19, 00:18)-=Rapidfire=- Wrote: [ -> ]Hi, I think I was not exact enough about the odd representaion of your regex.
Please have a look at your string in the code block in post #2. The characters witch were substituted in my post are completly missing there. Copy paste has lead to errors in this case (missing colon and bracket).
Sorry I don't really notice a difference. But I am a bit stressed for time so probably missing it. Just use a code box in future. Button 25 and type xml in the pop up box.

Image

Instead of...
xml:
<tvshowmatching action="append">

try...
xml:
<tvshowmatching action="prepend">

See here for more details... https://kodi.wiki/view/Advancedsettings....owmatching

Sorry, I am not avoiding your regex questions... I just can't answer them. Sounds like you have more knowledge about regex than I do Smile
(2021-03-19, 02:13)Karellen Wrote: [ -> ]
(2021-03-19, 00:18)-=Rapidfire=- Wrote: [ -> ]Hi, I think I was not exact enough about the odd representaion of your regex.
Please have a look at your string in the code block in post #2. The characters witch were substituted in my post are completly missing there. Copy paste has lead to errors in this case (missing colon and bracket).
Sorry I don't really notice a difference. But I am a bit stressed for time so probably missing it. Just use a code box in future. Button 25 and type xml in the pop up box.

Image

Instead of...
xml:
<tvshowmatching action="append">

try...
xml:
<tvshowmatching action="prepend">

See here for more details... https://kodi.wiki/view/Advancedsettings....owmatching

Sorry, I am not avoiding your regex questions... I just can't answer them. Sounds like you have more knowledge about regex than I do Smile

Hi and thanks that you are taking your time to answer my questions and please do not overestimate my regex abilities.
Now I am confused... your first listed code block looks like this:

Image
The problematic part is marked yellow. I believe thats not what you posted. Thats why I asked if it is possibly a bug.
Beacause of this I am not using the codeblock feature for regex. If this happens to regex the chances are high that the expression will no longer work for someone who copy pastes it.

I experimented with the "prepend" action without success. Somehow the default regex is still used.

VideoInfoScanner: Found episode match smb://...long_path.../TV-Show/Season1/S01E01E02E03E04/BDMV/index.bdmv (s1e1) [s([0-9]+)[ ._x-]*e([0-9]+(?Sad?:[a-i]|\.[1-9])(?![0-9]))?)([^\\/]*)$]
(2021-03-20, 00:37)-=Rapidfire=- Wrote: [ -> ]Now I am confused... your first listed code block looks like this:
Wow... Thanks for pointing it out. Yes, you are 100% correct and a bonus point for spotting it. Smile
I just tried to post it again, and same incorrect result.
Lets see if @ronie has any idea with both the forum issue, and the scanner regex for blurays.

This is what I meant to post...
Image
Hi,

just in case that someone has the same problem and for futrue referece I will note my "workaround".

It seems to me that for scanning TV-Shows the process will not stop when it finds a bdmv folder structure.
It will continue to grep everything it finds in that folder. Resulting in many files which are added to the library unintentionally.
The discussed regex additons to the advancedsettings.xml had no effect for me.

I decided to try to wrap the bdmv folder structure into a iso file. After some "research" I found this (source):

Code:
genisoimage -iso-level 4 -allow-lowercase -l -udf -allow-limited-size -V "TITLE" -o "/Title.iso" "/media/Title"

With this iso-file the naming like "TV-Show S03E06E07E08E09.iso" was scanned without a problem. No more unwanted additional files.
(2021-03-29, 12:29)-=Rapidfire=- Wrote: [ -> ]Hi,

just in case that someone has the same problem and for futrue referece I will note my "workaround".

It seems to me that for scanning TV-Shows the process will not stop when it finds a bdmv folder structure.
It will continue to grep everything it finds in that folder. Resulting in many files which are added to the library unintentionally.
The discussed regex additons to the advancedsettings.xml had no effect for me.

I decided to try to wrap the bdmv folder structure into a iso file. After some "research" I found this (source):

Code:
genisoimage -iso-level 4 -allow-lowercase -l -udf -allow-limited-size -V "TITLE" -o "/Title.iso" "/media/Title"

With this iso-file the naming like "TV-Show S03E06E07E08E09.iso" was scanned without a problem. No more unwanted additional files.

I have been struggling with adding my Game of Thrones 4K discs to Kodi.  I have ripped them as .iso files (a few as BDMV folders) but, despite naming the .iso files as you described above, I get a gazillion behind-the-scenes videos and the actual episodes are of the wrong season.  (Example, I added the Season 7 - first disc.  The actual episodes from that disc have been categorized as Season 8.)

Aside from renaming the .iso to the naming style you posted above, is there anything else I need to be doing?  All I really want is the disc to appear, when I launch it, I can then pick the episode to watch.  Any thoughts?
(2021-09-06, 00:36)digitalis Wrote: [ -> ]
(2021-03-29, 12:29)-=Rapidfire=- Wrote: [ -> ]Hi,

just in case that someone has the same problem and for futrue referece I will note my "workaround".

It seems to me that for scanning TV-Shows the process will not stop when it finds a bdmv folder structure.
It will continue to grep everything it finds in that folder. Resulting in many files which are added to the library unintentionally.
The discussed regex additons to the advancedsettings.xml had no effect for me.

I decided to try to wrap the bdmv folder structure into a iso file. After some "research" I found this (source):

Code:
genisoimage -iso-level 4 -allow-lowercase -l -udf -allow-limited-size -V "TITLE" -o "/Title.iso" "/media/Title"

With this iso-file the naming like "TV-Show S03E06E07E08E09.iso" was scanned without a problem. No more unwanted additional files.

I have been struggling with adding my Game of Thrones 4K discs to Kodi.  I have ripped them as .iso files (a few as BDMV folders) but, despite naming the .iso files as you described above, I get a gazillion behind-the-scenes videos and the actual episodes are of the wrong season.  (Example, I added the Season 7 - first disc.  The actual episodes from that disc have been categorized as Season 8.)

Aside from renaming the .iso to the naming style you posted above, is there anything else I need to be doing?  All I really want is the disc to appear, when I launch it, I can then pick the episode to watch.  Any thoughts?

Hi, sorry for my late response. Have not checked the forum for some time.
May you please show me one of your file names please?
I also have issues with TV shows that contain blu ray or dvd file structures with the same layout as in the first post. In my case no episodes are listed. Converting to iso files seems like a laborious but viable solution - thank you.