Jump to content

Using TinyMediaManager to Automatically Build Collection.xml


decrapinated

Recommended Posts

decrapinated

Hi everyone.  I use TinyMediaManager to do all of my metadata.  I happen to move my files around a lot based on my own organizational madness, lol.  This would KILL Emby's collections method.  I switched over from Plex a few days ago and this was maddening because I was used to using tags.  So I wrote an export template for TinyMediaManager that exports a list of movies in xml form.  I wrote my template to conform to Emby's collection.xml scheme and placed the xml in a "CollectionName [boxset]" folder in the Collections folder.  I was pleasantly surprised to find that it worked.  So, I can rearrange my files at will, use whatever folder and naming scheme that I wish, replace files with better quality rips, re-tag or rename, or pretty much do whatever i want.  I just thought that I'd share my methods for people in the same situation.

 

I have several MoviesFolders though, including a folder containing all the movies that I haven't watched yet.  There's also a folder of movies that I consider temporary residents on my hard drive.

 

TinyMediaManager keeps it's export templates in a folder named "templates" in the main program folder.  In this folder, I had to create a folder named "EmbyCollectionXML".  In that folder, I need 2 files.  I need a "template.conf" file and a "list.jmte" file.

 

TinyMediaManagerFolder\templates\EmbyCollectionXML\

 

In the conf file I needed the following:

 

name =EXCEL list

type=movie

list=list.jmte

extension=xml

description=This template exports a valid Emby collections.xml file

 

In the list.jmte I needed the following:

 

<?xml version="1.0" encoding="UTF-8"?>
<Item>

  <LockData> true </LockData>

  <LocalTitle>Collection Title</LocalTitle>

  <DisplayOrder>PremiereDate</DisplayOrder>

  <CollectionItems>
  ${foreach movies movie}
    <CollectionItem>
        ${foreach movie.mediaFiles mediaFile} ${if first_mediaFile}<Path>${mediaFile.path}\\${mediaFile.filename}</Path>${end} ${end}
    </CollectionItem>
  ${end}
  </CollectionItems>
 
</Item>

 

This template exports an xml that writes the path for every one of your movies inside a CollectionItem.

 

In TinyMediaManager, I simply filter the list by tags or by "datasource" or by  whatever I want, then I export the list using my template.  Open that xml and change "Collection Title" to whatever the name of my Collection will be.  Rename the xml to "Collection Title.xml"

 

Create a folder inside your Emby Collections folder: 

\Emby-Server\programdata\data\collections\Collection Title [boxset]\

 

Place your xml in that folder.  I put a folder.jpg in there too for my collection.  I refreshed my Collections in Emby and BOOM:  There it was.  I don't know if this will be helpful for anyone else, but that's how I do it for my custom collections that plugins might not pick up and to deal with me moving stuff around occasionally.  It's best for big collections or random custom collections.  Oh, and the reason I can't just filter by tags on the movies screen is because I'm using the Tizen version of Emby client on a Samsung Smart TV.  That means if I filter and there aren't enough movies, I can't get back to that "Filters" button.  It's been discussed in another thread.

post-393777-0-71341100-1553198633_thumb.jpg

post-393777-0-75701300-1553198634_thumb.jpg

post-393777-0-21039100-1553198635_thumb.jpg

post-393777-0-53796100-1553198635_thumb.jpg

post-393777-0-40244100-1553198636_thumb.jpg

post-393777-0-82306500-1553198636_thumb.jpg

Edited by decrapinated
  • Thanks 1
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...