but still, i don't understand why this is not possible with filebot .. emby/plex is often the only place where stuff is organized in messed up libraries .. so converting back from plex/emby db's seems like a obvious thing to do :/
well thanks anyway
Naming files from local PLEX database
Re: Naming files from local PLEX database
Why not go with the previously suggested solution though? The XML file does seem to include the file paths for each file in the library, no?
viewtopic.php?p=54468#p54468
1. Use Tautulli to export the information we need as easy-to-read XML file
2. Use custom Plain File Format to generate nice file paths based on the information in the XML file
3. Done
viewtopic.php?p=54468#p54468
1. Use Tautulli to export the information we need as easy-to-read XML file
2. Use custom Plain File Format to generate nice file paths based on the information in the XML file
3. Done
Re: Naming files from local PLEX database
e.g.snickers2k wrote: ↑01 May 2021, 20:35 yeah i'm sorry but i found out too late that there is no filepath exported to work with :/
Code: Select all
<location>/mnt/media/Spielshows/Denn sie wissen nicht was passiert/Denn.sie.wissen.nicht.was.passiert.S03E04.GERMAN.1080p.HDTV.x264-aWake-xpost/awa-desiwiniwapas03e04xd.mkv</location>
Code: Select all
...file="/mnt/media/Spielshows/Denn sie wissen nicht was passiert/Denn.sie.wissen.nicht.was.passiert.S03E04.GERMAN.1080p.HDTV.x264-aWake-xpost/awa-desiwiniwapas03e04xd.mkv"...
Re: Naming files from local PLEX database
Well, I guess Plex wouldn't be able to find / play the file it wasn't where Plex thinks it is anyway.
But even if we were to use the exported XML file from a remote server, and then run FileBot on the local Desktop, the file name alone is probably unique enough to establish a 1:1 link so we don't need to rely on an exact file path match:
Code: Select all
dom.show.season.episode.media.part.find{ it.'@file'.text().toFile().name == f.name }
Code: Select all
{
// find <part> element for the file at hand
def dom = xml('/path/to/library.xml')
def part = dom.show.season.episode.media.part.find{ it.'@file'.text().toFile().name == f.name }
// navigate parent elements and access attributes
def n = part.'..'.'..'.'..'.'..'.'@title'.text()
def s = part.'..'.'..'.'..'.'@index'.text() as int
def e = part.'..'.'..'.'@index'.text() as int
def t = part.'..'.'..'.'@title'.text()
// generate file name
"${n} - S${s.pad 2}E${e.pad 2} - ${t}"
}