Import of movie names from custom directory layout

TL;DR

I have a custom directory layout and naming scheme for my movie collection:

Code:
CATEGORY/LANGUAGE/SET/SOURCE_TYPE/[SOURCE_ID] SOURCE_TITLE (YEAR)/PART_ID/CONTENT
  • CATEGORY: e.g. fictional, non-fictional, show, music video
  • LANGUAGE: (main) language
  • SET: (optional) name of a set that groups several movies logically
  • SOURCE_TYPE: e.g. DVD, BD, TV, YouTube
  • SOURCE_ID: ID of the original source (e.g. publisher + catalog id, TV channel + date, YouTube ID)
  • SOURCE_TITLE: title of the original source (e.g. movie or box set)
  • YEAR: (optional) year of the release of the original source
  • PART_ID: ID or name of one part, which may be one single movie, several movies (TV series) or part of a movie (spanning multiple discs)
  • CONTENT: the actual data, either as directory (DVD, BD, SVCD), single file or multiple files

Unfortunately, this layout seems to be too complicated for use with Kodi because only the name of a file or its parent directory is used to identify a movie.

How can I best import my data into Kodi without renaming or moving files?

Currently, I have the following ideas:

  1. Create a feature request to support the full file path for movie- & folderstacking
  2. Write a script that generates NFO files from the directory layout
  3. Write a scraper

Comments? Ideas? What is the “Kodi” way to solve this problem?


The full story

I try to keep every file in its original format and to avoid format conversion wherever possible. I chose the above directory scheme to support this. It may look quite complicated, but it’s universal enough to cover everything that I own, e.g. rips of physical discs, TV recordings, downloads and self-made videos. See down for some examples.

For TV series with multiple episodes per disc, I created a second directory hierarchy with 1 symbolic directory link per episode, e.g.
TV Series/Fictional/German/Columbo/Season 1/Episode 5 is a symbolic link to Movies/Fictional/German/Columbo/DVD/[Universal – 823 041 9] Die komplette erste Staffel (2005)/DVD 1.

OK, now I have this universal but proprietary directory layout. I’ve been using MediaPortal in the past, and it was possible to import my data using some plugins, scrapers and a little bit of manual work. I didn’t find a way to achieve this in Kodi yet.

I activated Settings / File lists / Combine split video items and tried Movies are in separate folders that match the movie title. I’ve browsed through the forum, read about Naming video files, Moviestacking and Folderstacking and tried some regular expressions. If I understand it right, Kodi uses either the name of a file or its parent directory to identify a movie. Unfortunately this is not enough for my use case, I need at least a regular expression on the complete file path. I’m not sure if this would be enough for all cases (see example “Der Herr der Ringe” below) but I hope these exotic cases could be handled by a NFO file.

Examples

Blu-ray:

Code:
Movies/Fictional/German/-/BD/[Brainpool 88843052679] Stromberg Der Film/BD 1/BDMV/STREAM/00000.m2ts

DVD:

Code:
Movies/Fictional/German/-/DVD/[Constantin - 74321 89686 9] The Score (2002)/DVD 1/VIDEO_TS/VIDEO_TS.IFO

DVD-Box:

Code:
Movies/Fictional/German/-/DVD/[Columbia - 70103] Montys EnzykloPythonia (2003)/DVD 1 - Das Leben des Brian/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/-/DVD/[Columbia - 70103] Montys EnzykloPythonia (2003)/DVD 2 - Ritter der Kokosnuss/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/-/DVD/[Columbia - 70103] Montys EnzykloPythonia (2003)/DVD 3 - Ritter der Kokosnuss (Bonus Disc)/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/-/DVD/[Columbia - 70103] Montys EnzykloPythonia (2003)/DVD 4 - Der Sinn des Lebens/VIDEO_TS/VTS_01_0.IFO

DVD-Box with disc spanning:

Code:
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15527] Der Herr der Ringe - Die Gefährten (2001)/DVD 1 Seite A/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15527] Der Herr der Ringe - Die Gefährten (2001)/DVD 1 Seite B/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15527] Der Herr der Ringe - Die Gefährten (2001)/DVD 2/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15528] Der Herr der Ringe - Die zwei Türme (2002)/DVD 1 Seite A/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15528] Der Herr der Ringe - Die zwei Türme (2002)/DVD 1 Seite B/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15528] Der Herr der Ringe - Die zwei Türme (2002)/DVD 2/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15529] Der Herr der Ringe - Die Rückkehr des Königs (2003)/DVD 1 Seite A/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15529] Der Herr der Ringe - Die Rückkehr des Königs (2003)/DVD 1 Seite B/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Der Herr der Ringe/DVD/[Warner - Z5 Y15529] Der Herr der Ringe - Die Rückkehr des Königs (2003)/DVD 2/VIDEO_TS/VIDEO_TS.IFO

TV:

Code:
Movies/Fictional/German/-/TV/[2011-11-27 ProSieben] Das Experiment/FILE/Das Experiment.ts
Movies/Fictional/German/-/TV/[2002-01-12 ProSieben] Event Horizon/SVCD 1/MPEG2/AVSEQ01.MPG

TV series:

Code:
Movies/Fictional/German/Columbo/DVD/[Universal - 823 041 9] Die komplette erste Staffel (2005)/DVD 2/VIDEO_TS/VIDEO_TS.IFO
Movies/Fictional/German/Columbo/TV/[ORF1] Alter schützt vor Torheit nicht/FILE/S2E4_Part1 Alter schützt vor Torheit nicht.mpg
Movies/Fictional/German/Columbo/TV/[ORF1] Alter schützt vor Torheit nicht/FILE/S2E4_Part2 Alter schützt vor Torheit nicht.mpg
Movies/Fictional/German/Es war einmal... das Leben/YouTube/[o8xpXlZ-COg] Die Zelle/FILE/S01E01 Die Zelle.mp4
Movies/Fictional/German/Mega Man/VHS/[ProSieben Entertainment - 70007-3] Aller Anfang ist schwer/FILE/[S1E01] Aller Anfang ist schwer.mpg
Movies/Fictional/German/Mega Man/VHS/[ProSieben Entertainment - 70007-3] Aller Anfang ist schwer/FILE/[S2E09] Die Robouniversität.mpg
Movies/Fictional/German/The Powerpuff Girls/TV/[SUPERRTL] The Powerpuff Girls/DVD 1/VIDEO_TS/VIDEO_TS.IFO

Shows:

Code:
Movies/Shows/German/Helge Schneider/TV/[2004-04-29 WDR] Prix Pantheon 2004 - Helge Schneider Solo/DVD 1/VIDEO_TS/VIDEO_TS.IFO
Movies/Non-Fictional/German/SAT.1 News & Stories/TV/[2003-11-30 SAT.1] Einstürzende Doppelsterne/FILE/Einstürzende Doppelsterne.mpg

Personal:

Code:
Movies/Personal/German/School/Camera/[2000-01] Theater Performance/DVD 1/VIDEO_TS/VIDEO_TS.IFO
Movies/Personal/German/Family/Camera/[2010-01-01] Marriage/BD 1 - Ceremony/BDMV/STREAM/00000.m2ts