INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: External Script or tool to populate media library fields  (Read 15097 times)

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
External Script or tool to populate media library fields
« on: April 20, 2012, 10:36:22 pm »

I am slowly migrating from XBMC for movies and TV series. On XBMC I have painstakingly used external media managers to create a metadata files (.nfo, .tbn, .jpg...) which XBMC recognizes and uses in the various views. I have my own system of media tagging, genres etc... I have put an enormous amount time and effort to get things just the way I like them. Of course Media Center 17 won't make use of these metafiles (correct me if I am wrong) but is quite flexible and I can create custom fields for most anything which is great.

What I am looking for is a script/tool/import process/anything that I can use to automate the import the details from my current metafiles and map the appropriate fields to Media Center 17 library fields. I have come across a few threads that refer to tools but they seem to be quite old so may be not compatible any more.

Can anyone offer any guidance?
Logged
For every expert, there is an equal and opposite expert.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: External Script or tool to populate media library fields
« Reply #1 on: April 20, 2012, 11:10:21 pm »

Hi there.

Here's a quick high-level overview response, presuming you'll have some follow-up questions.

You can probably add new extensions to recognize your .nfo text files and the .tbn image files:

   http://yabb.jriver.com/interact/index.php?topic=68567.0

Once you've done that, you can import those files.  Configure Tools > Import... > Configure Auto-Import and include the file types of the files.

Now you'll want to create views to see these files alongside your media files.  You can configure the views to group by file path, so that these related files group correctly.  You might find all of these easier in a Panes view.  Here's an extensive overview of how to create views:

  http://yabb.jriver.com/interact/index.php?topic=68960.5

You'll want to include your all the relevant file types in the Set rules for file display... section of the view.

The text files should have their info imported, I believe in the Text field.  An image file can be associated with a media file, but there are rules as to how artwork is managed.  See Cover Art:

   http://wiki.jriver.com/index.php/Cover_Art

Since .nfo files are free-format text files, it is not clear what you're looking for in terms of importing.  Perhaps you can expand on this when necessary.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: External Script or tool to populate media library fields
« Reply #2 on: April 21, 2012, 12:40:57 am »

What I am looking for is a script/tool/import process/anything that I can use to automate the import the details from my current metafiles and map the appropriate fields to Media Center 17 library fields.

This is what you need...

Don't forget, full "sidecar" support exists, and how many tools/systems can build an XML file?  I wrote a CL tool in two hours the other day to convert some XBMC XML files in to JRiver format.  Then I hit one "Update Library from Tags" - all done.  Maybe with enough encouragement, I can build that tool out more significantly.  8)

Quote
I have my own system of media tagging, genres etc... I have put an enormous amount time and effort to get things just the way I like them.

How do you intend to continue to collect the same data? That might have some bearing on how to best import what you've already got.

Logged

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
Re: External Script or tool to populate media library fields
« Reply #3 on: April 21, 2012, 09:00:43 am »

Awesome, thanks guys. I looked in my small videos test directory and sure enough there were jrsidecar files there. It was obviously created at one time but I can't seem to update those files anymore.

The info I found states that sidecar files get updated when I do a Library Tools > Update Tags (from library). Every time I do though I get a "1 files updated (1 failures)". I cannot find out what the error is. I have looked in the log file but don't see anything indicating an error. How can I find out what the issue is?

Thx
Logged
For every expert, there is an equal and opposite expert.

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
Re: External Script or tool to populate media library fields
« Reply #4 on: April 21, 2012, 09:07:42 am »

rick

To answer your question, I use a program called Media Companion to scrape all my movies and shows. It pulls the posters, fanart and creates the nfo files. I then manually overwrite genre and a few other things with my tags and once I am happy, I fire up XBMC and it just pulls it all in. I like it because I can easily select my preferred poster/fanart and such.
Logged
For every expert, there is an equal and opposite expert.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: External Script or tool to populate media library fields
« Reply #5 on: April 21, 2012, 08:01:55 pm »

The info I found states that sidecar files get updated when I do a Library Tools > Update Tags (from library). Every time I do though I get a "1 files updated (1 failures)". I cannot find out what the error is.

That 'error' will happen if the option to save data to sidecar files is not set. Type "Ctrl+O sidecar" and set the option to 'Video'.

Quote
To answer your question, I use a program called Media Companion to scrape all my movies and shows.

Media Companion seems to be a reasonably good solution. The data it retrieves is fixed and somewhat limited, but not as much as the MC system. And I suppose you may get better results with a different configuration. It seems there's an outstanding issue preventing it from downloading posters at full resolution, but I suppose that will be fixed in due course.

What's needed is a tool for translating the NFO (presumably equivalent to XBMC XML) files to MC's sidecar format, while leaving the original NFO files intact. Although the data set is fairly standard, the translation probably needs to be configurable so data can be mapped to the fields you want to use (including custom fields). There would be a few issues to resolve, like how to save the actor/role data and what might be done with the actor image links, if anything. But those are just choices to be made. The actor/role data, for example, can be saved in [Actors] as 'Actor\Role', and it will behave as a nested list. If JRSidecar files (named '[Filename]_ext_JRSidecar.xml') can be created, then I believe MC will import those automatically (for both new files and updates).

So now the question is, what type of "encouragement" does olinbg need to help you out? It doesn't appear that he's here regularly, so you may want to send him a personal message. Or there may be others around capable of doing the same thing.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: External Script or tool to populate media library fields
« Reply #6 on: April 21, 2012, 08:17:22 pm »

If you can, please post an .nfo file - let's see what it looks like.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: External Script or tool to populate media library fields
« Reply #7 on: April 21, 2012, 09:40:41 pm »

Quote
If you can, please post an .nfo file - let's see what it looks like.

Examples attached (with NFO changed to TXT).
Logged

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
Re: External Script or tool to populate media library fields
« Reply #8 on: April 21, 2012, 10:05:02 pm »

That sidecar option did the trick, I don't think I would have figured that out on my own without much frustration. You guys are awesome. I think I am going to like it here :)

As far as the nfo file goes, it's standard XBMC stuff except for a few personal touches. I am new to this forum and am not sure what the preferred way to attach stuff so if you would like to see it just let me know how.

First, just let me say, I think I will be fine from this point forward. I will just spin up my Linux VM and get a script going to do the work. I don't do this stuff much any more but I still dabble here and there.

An import option for XBMC nfo files would be awesome. I am sure there are probably other XBMC folks who might find it helpful. Like I said, the nfo is an xml file that XBMC recognizes. My tweaks include a genre naming convention that includes special tags to identify how the mkv was ripped and bitrate stuff, if it's a movie, concert, or documentary, and a basic genre like action, fantasy etc... (I stick to a handful of genres) I chose to use the genre tag for this because XBMC is no where near as configurable as MC17 and was just convenient. Also, I am a technical detail nut I always ensure to set codec tags appropriately (i.e for me DTS MA is not the same as DTS) and I make use of the originaltitle field to embed media details.

Finally, I have been using XBMC for close to three years. As a media manager, it's beautiful. For playback quality it sucks. I invoke MPC-HC with madVR and LAV Filters for that. I use the XEON MQ3 skin and made my own little mods to it. I visit the madVR and LAV forums daily and MC17 is often mentioned by a few like SamuriHL, so after much thought I made the purchase and here I am :)

Thanks guys.
Logged
For every expert, there is an equal and opposite expert.

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
Re: External Script or tool to populate media library fields
« Reply #9 on: April 21, 2012, 10:07:40 pm »

Damn rick.ca , you are quick.

Those nfo are pretty much it. Personally, I strip out all the alternativetitles and I limit actors to 5.
Logged
For every expert, there is an equal and opposite expert.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: External Script or tool to populate media library fields
« Reply #10 on: April 21, 2012, 11:44:23 pm »

Quote
First, just let me say, I think I will be fine from this point forward. I will just spin up my Linux VM and get a script going to do the work. I don't do this stuff much any more but I still dabble here and there.

You mean to say you're capable of creating the same sort of tool olinbg mentioned? That would be convenient, especially it were in a form that can be shared (e.g., not something that only works in Linux). I imagine a script which is translating tags to MC field names could be easily modified to map the data to the fields they want to use (particularly where the data necessarily goes to a custom field).
Logged

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
Re: External Script or tool to populate media library fields
« Reply #11 on: April 22, 2012, 05:57:34 am »

On Linux, yes I could. It's really only a simple substitution. The sidecar format is very basic, which is great. I have tested and it works as advertised, I created a simple test sidecar file containing four custom library fields and I was able to import them and they took just fine. This was just what I was looking for when I created the thread.

I would happily share with the community but I have a specific environment where I run a Linux VM on my Windows server and the two share a directory. The common directory is what makes it all possible without making life complicated. I then replicate my video library directory structure (1 video per folder) with only the nfo files in it. This incidently would be quite a pain to do without the windows file manager I use (Directory Opus). It is quite awesome and can do this with a few clicks. Finally I will create the script to traverse the directories, read the nfo and create a new sidecar for each with just the fields I want to update. Anyhow, long story short, it will work for me because I have the setup for it. I have the set-up because I periodically build demo databases for work for which the process I go through is remarkably similar.

Logged
For every expert, there is an equal and opposite expert.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: External Script or tool to populate media library fields
« Reply #12 on: April 22, 2012, 11:29:57 am »

OK, sounds like you have a good solution.  I was going to write a quick Perl script (while watching The Girl with the Dragon Tattoo) to convert from one format to the other.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: External Script or tool to populate media library fields
« Reply #13 on: April 22, 2012, 04:15:02 pm »

Quote
OK, sounds like you have a good solution.  I was going to write a quick Perl script (while watching The Girl with the Dragon Tattoo) to convert from one format to the other.

I'm still curious to see how something like this might work. If it can be easily modified to map fields as the user sees fit and would create valid MC sidecar files for all NFO (or other type of XML) files found under a root folder, it may of use to anyone coming from XBMC—and more.

BTW, I feel much better about asking you to do these things, now I know they help keep you occupied when watching movies. ;)
Logged

Boltron

  • Junior Woodchuck
  • **
  • Posts: 94
Re: External Script or tool to populate media library fields
« Reply #14 on: April 22, 2012, 04:42:53 pm »

Are you watching the original The Girl with the Dragon Tattoo or the remake?
Logged
For every expert, there is an equal and opposite expert.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: External Script or tool to populate media library fields
« Reply #15 on: April 22, 2012, 06:45:04 pm »

@ Boltron - We watched the 2011 remake; enjoyed it, esp. the Reznor/Ross score.  Hopefully we'll see the 2009 Swedish version soon.

@ rick.ca - i was thinking of using a user-defined associative array (a hash) to map fields.  A user would specify an arbitrary mapping such as:

   Actors => Actor\Role
   Name => Series
   Genre => Keywords

The associations could be specified either in a config file or in the script itself.  This kind of mapping is one of perl's strengths so its easy to do.
Logged
The opinions I express represent my own folly.

rick.ca

  • Citizen of the Universe
  • *****
  • Posts: 3729
Re: External Script or tool to populate media library fields
« Reply #16 on: April 22, 2012, 07:56:18 pm »

Quote
Actors => Actor\Role

I'm not sure if there's anything else that could be done with [Role], so by this I assume you mean Actor\Role => [Actors] (as list items).

Quote
The associations could be specified either in a config file or in the script itself.

I imagine this part of the script would be easy to understand, so the latter is probably easier. How would the root folder to process be specified? Would one script work for both movies and series, or would separate be required (or easier)?

Reznor theme music would be cool. ;)
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: External Script or tool to populate media library fields
« Reply #17 on: April 22, 2012, 08:09:07 pm »

I'm not sure if there's anything else that could be done with [Role], so by this I assume you mean Actor\Role => [Actors] (as list items).

I imagine this part of the script would be easy to understand, so the latter is probably easier. How would the root folder to process be specified? Would one script work for both movies and series, or would separate be required (or easier)?

Reznor theme music would be cool. ;)

Command line or drag-n-drop or via static config file.  It would/could depend on the perl runtime being used.  On a Windows system, either Cygwin's perl could be used, or ActivePerl for drag-n-drop.   I haven't looked at this in great detail - first glance shows it to be a mapping of one XML schema to a list of properties, where multvalue properties would be flattened into an MC compatible list-string.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up