Jump to content

Transitioning to Emby: How to Programmatically Add Many Items to Collections


funwithmedia
Go to solution Solved by Luke,

Recommended Posts

funwithmedia

I'm in the midst of transitioning all of my movies, etc. to Emby from my old, custom built solution. I have ~1500 video files that I have previously had tagged and grouped under several broad categories (these are all "shorts", like old Donald Duck cartoons). Because there are so many, I want to be able to programmatically add them all to their appropriate Collections in Emby (so that I don't have to manually add 1500 items!!).

 

The easiest thing for me would be if I could put <set>Donald Duck Shorts</set> (or whichever Collection was appropriate) in the corresponding .NFO file prior to importing into Emby. I'll be generating the .NFO files anyway in order to export things like Tags and and IMDB link (for accurate identification). However, in my initial testing it seems that the <set> data is ignored on import (in my test, I first created a Collection named "Donald Duck Shorts").

 

My other option is I could programmatically add all of my items to the collection.xml file contained within

C:\Users\USERNAME\AppData\Roaming\Emby-Server\data\collections\Donald Duck Shorts [boxset]

but due to how I'm transitioning my data that option is less ideal (though I can find a way to make that work if it is the only or best route).

 

Is there anything I can put in an .NFO (prior to the item being added to Emby) that Emby would then automatically add it to the appropriate Collection for me (ie, add it to the above collection.xml file)? I know there are some old, folder-based ways of doing Collections which are not fully supported anymore, but I'd prefer to do this in a way that will register the data in Emby in the new architecture (ie, result in the data being stored in Emby as if I had manually added all of these items via the interface).

 

I should also add (in case it matters) that I will want to add items to multiple Collections (eg, "Donald Duck Shorts", "Goofy Shorts", and "Disney Shorts") as these basically functioned for me previously like Tags (I'll also be tagging everything with much the same names/tags) and so a given item can have multiple tags/associations, depending on the content of the item.  Looking that Kodi page (which I believe the Emby convention borrows from) http://kodi.wiki/view/NFO_files/Movies I do wonder if multiple <set> tags would even work (if they were being read on import by Emby).

 

Thanks much for any help!

:)

Link to comment
Share on other sites

  • Solution

Hi, we don't currently do anything with the tag, other than preserve it so that Kodi can read it. I guess from a programattic standpoint you would have to create your own collection xml file.

  • Like 1
Link to comment
Share on other sites

Another option would be to fill in the tmdb Collection Id on the items and let Auto Box Sets create them for you.

  • Like 1
Link to comment
Share on other sites

funwithmedia

That's a great idea, but I should have been clearer that these collections will all be custom (as in, they're not going to have a TMDB Collection ID). I actually did some searching in the TMDB prior to starting this thread to see if I could go that route, but the few test searches I did yielded no results (which is not surprising, as these 1500 videos are all "shorts", not movies in the traditional sense).

 

I might do what you're suggesting for some movies though (although there's so few of those, comparatively, that just adding them to Collections via the interface is fine).

 

Thanks for chiming in though!

Link to comment
Share on other sites

You might be able to get the plug-in to create your collections for you by using any unique identifier you wish that did NOT match with a valid tmdb ID.  I think it would create the collection but just not find any meta data for the collection itself.

 

But, maybe, at that point, it is just easier to use the web interface to create the collections manually.

Link to comment
Share on other sites

moviefan

It would be really cool if someone could create a plugin that could extract data from collection.xml files within folders using the legacy style and and create all the necessary collection.xml files for the new folder structure.  This would finally solve the collection problem for me.

Link to comment
Share on other sites

funwithmedia

You might be able to get the plug-in to create your collections for you by using any unique identifier you wish that did NOT match with a valid tmdb ID.  I think it would create the collection but just not find any meta data for the collection itself.

 

But, maybe, at that point, it is just easier to use the web interface to create the collections manually.

That's a clever idea, but I think I feel better about just writing data directly to the collections.xml file as that feels more certain/reliable. While it's a little less ideal than what I'd like (which would be to store some piece of data in each video's NFO file), I know for certain that writing data to the app directory collections.xml files will definitely work, so I'm inclined to stick with that (because of how many items I'm working with here, ie, ~1500). It's a bit of a different program flow than what I was wanting, but still totally doable (I expect). :)

Link to comment
Share on other sites

funwithmedia

Just wanted to give an update. I've been having trouble getting changes in collection.xml files (the ones created by Emby in the app directory) to be recognized in Emby (I've tried the obvious of doing a manual Refresh of the Collection item in Metadata Manager, as well as just allowing time for Emby to notice and integrate the change). I don't think I'm going to try to troubleshoot this any further, but I wanted to give the update for the benefit of others exploring this route in the future.

What I have decided to do instead is use Tags (and tagging via the NFO files has worked great!!) to get a filtered view (this is viewing the library via the server library browser), and then using the nifty mult-select I can manually add everything to the appropriate Collection. I will say that a "Select All" would be incredibly helpful here, as it is going to be quite tedious to manually select hundreds and hundreds of items at a time. BUT, I only have to do it once (per Collection), so it's not a huge deal.  ;)

Thanks again everyone for all your suggestions and help!

Link to comment
Share on other sites

Deathsquirrel

FYI, you don't necessarily need to do this through collections or tags.  Your Disney shorts have TVDB entries.  Properly named and organized, they'll get picked right up as TV shows.

  • Like 1
Link to comment
Share on other sites

funwithmedia

Actually, the majority of these are really old and I don't think are categorized as TV shows (ie, most were originally shown in movie theaters, before home TV's existed, or were common). For example,

https://www.themoviedb.org/movie/78485-sea-scouts

http://www.imdb.com/title/tt0031905/

 

Some of the more recent stuff I have might be though, so I'll certainly have a look at that when I get to those. Thanks much for the thought!

Link to comment
Share on other sites

funwithmedia

Oh wow -- I had done a quick search and didn't find anything, but I'll have to look through all that. What you all are suggesting would be a different approach than I was planning on, but perhaps it would be better.  I'll have to chew on that a bit...

 

Thanks @@Deathsquirrel and @@Happy2Play! :)

Link to comment
Share on other sites

Happy2Play

I use a tool like Filebot to rename things like this, as it has a fuzzy search by title that can find season/episode number.  Even if it is named just "Sea Scouts" a pop-up shows up to select the proper series or you enter the series name.

 

586d75b9aa617_disney.jpg

Edited by Happy2Play
  • Like 1
Link to comment
Share on other sites

Deathsquirrel

I have a number of those collectible DVD tins of Disney cartoons so I've been through this when I ripped them.  As noted, it's a bit of work but I love the results.  I can select Disney Animated Shorts or Looney Tunes, hit the Shuffle option, and have a string of random cartoons for as long as I want it.

 

edit--now if only Warner would release more Looney Tunes Platinum sets :(

Edited by Deathsquirrel
  • Like 2
Link to comment
Share on other sites

funwithmedia

I have a number of those collectible DVD tins of Disney cartoons so I've been through this when I ripped them.  As noted, it's a bit of work but I love the results.  I can select Disney Animated Shorts or Looney Tunes, hit the Shuffle option, and have a string of random cartoons for as long as I want it.

 

edit--now if only Warner would release more Looney Tunes Platinum sets :(

Amen!! :(

 

And yeah, I'm looking forward to that kind of functionality. :) Fortunately, I ripped them all to individual files years ago, and they're each associated with the corresponding IMDB id within my custom database. So the main thing at this point is just deciding on how I want to group/organize them within Emby (so that I can be sure to export the data to NFO files properly). In my old setup my structure was basically tag-based: So I had tags like "Disney", "Shorts", "Donald Duck", "Goofy", etc. as well as "Looney Toons", "Bugs Bunny", etc. So, "Shorts" gives me ALL of my shorts, "Disney" and "Shorts" gives me all Disney shorts, and so on. Personally, I liked how that worked and it felt intuitive for me. So my default is to try to setup Collections to function in the same way.

 

I use a tool like Filebot to rename things like this, as it has a fuzzy search by title that can find season/episode number.  Even if it is named just "Sea Scouts" a pop-up shows up to select the proper series or you enter the series name.

 

 

Oh my gosh -- that is going to be AMAZING for me when I start looking at ripping my TV shows to individual files!!!!!  Thank you so much for sharing that!  :)

Link to comment
Share on other sites

funwithmedia

@Happy@Play, any experience with TheRenamer ( http://www.therenamer.com )? It seems very similar to FileBot. Is FileBot free? There's a version on the Windows store ( https://www.microsoft.com/en-us/store/p/filebot/9nblggh52t9x)that costs money (which is not my preferred way to buy software), but it seems like you can also download it direct from Sourceforge (https://sourceforge.net/projects/filebot/).

 

I welcome any thoughts/recommendations (from anyone) regarding these two.

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