Child pages
  • NfoMovieMetadataExtractor

  Wiki Navigation

    Loading...


 Recently Updated


 Latest Releases

 MediaPortal 1.24 
            Releasenews | Download
 MediaPortal 2.2.3
            Releasenews | Download

Table of Contents

Overview

The NfoMovieMetadataExtractor extracts metadata from

nfo-files

for movies. It is one of currently two NfoMetadataExtractors. This wiki page describes particularities of the NfoMovieMetadataExtractor. General information applicable to all NfoMetadataExtractors can be found here.

Properties

Property Name

Property Value

metadataExtractorId

F1028D66-6E60-4EB6-9987-1C34D4B7813C

name

Nfo movie metadata extractor

metadataExtractorPriority

MetadataExtractorPriority.Extended

processesNonFiles;

true

shareCategories

Movie

extractedAspectTypes

MediaAspect

,

VideoAspect

,

MovieAspect

,

ThumbnailLargeAspect

 

Note: The

metadataExtractorPriority

is intentionally (and incorrectly) set to

Extended

although, depending on the content of the

nfo-file

, it may download thumbs from the internet (and should therefore be

External

. This is a temporary workaround for performance purposes. It ensures that this MetadataExtractor is applied before the VideoThumbnailer (which is intentionally and incorrectly set to

External

although it only uses local files). Creating thumbs with the VideoThumbnailer takes longer than downloading them from the internet.

Settings

Besides the general settings available for all NfoMetadataExtractors, the NfoMovieMetadataExtractor has the following settings:

 

Name

Type

Default Value(s)

Explanation

MovieNfoFileNames

HasSet<string>

movie

File name that is used (besides the

Resource

's file name and in combination with any of the

NfoFileNameExtensions

) to identify a

nfo-file

for a particular

Resource

 

The settings file name for the NfoMovieMetadataExtractor is

MediaPortal.Extensions.MetadataExtractors.NfoMetadataExtractors.Settings.NfoMovieMetadataExtractorSettings.xml

Requirements

Besides the general requirements applicable to all NfoMetadataExtractors the NfoMovieMetadataExtractor has the following requirements to be able to extract metadata:

Other MetadataExtractors

The NfoMovieMetadataExtractor can only extract metadata for video

Resources

. It will therefore only try to extract metadata if any MetadataExtractor applied before the NfoMovieMetadataExtractor (i.e. having

MetadataExtractorPriority.Core

) has recognized the

Resource

as a video and added a

VideoAspect

. This is typically done by the VideoMetadataExtractor. If no

VideoAspect

is present when the NfoMovieMetadataExtractor is called, the NfoMovieMetadataExtractor will do noting.

Directory and File Name Structure

The NfoMovieMetadataExtractor tries to find exactly one

nfo-file

for every

Resource

, the

matching nfo-file

. To be identified as the

matching nfo-file

, it needs to be located at a specific path relative to the

Resource

and its file name needs to follow a certain pattern.

To be identified as

matching nfo-file

for a movie

Resource

, the

nfo-file

needs to be located in the

parent directory

of the

Resource

.

  • If the

    Resource

    is a file, the

    parent directory

    is the directory in which the file is located.

    Nfo-files

    for movie files must therefore be located in the same directory as the movie file.

  • If the

    Resource

    is the root directory of a

    ChainedResourceProvider

    (such as in case of a DVD iso file), the

    parent directory

    is the directory in which the file that was unfolded by the

    ChainedResourceProvider

    is located.

    Nfo-files

    e.g. for movie iso files must therefore be located in the same directory as the movie iso file.

  • If the

    Resource

    is a directory (such as in case of a directory, to which the content of a DVD was copied), the

    parent directory

    is the directory containing that

    Resource

    directory.

The file name of the

matching nfo-file

must be

  • either the

    ResourceName

    ;

    • If the

      Resource

      is a file, the

      ResourceName

      is the file name of the

      Resource

      (without file name extension).

    • If the

      Resource

      is the root directory of a

      ChainedResourceProvider

      (such as in case of a DVD iso file), the

      ResourceName

      is the file name of the file that was unfolded by the

      ChainedResourceProvider

      (without file name extension).

    • If the

      Resource

      is a directory (such as in case of a directory, to which the content of a DVD was copied), the

      ResourceName

      is the name of that directory.

  • or any of the values of the

    MovieNfoFiles

    settings.

Obviously, for the NfoMetadataExtractor to be able to work correctly, in the second case multiple movie

Resources

each need to be contained in their own directory, whereas in the first case multiple movie

Resources

can be located in the same directory.

The file name extension of the

matching nfo-file

must be any of the values contained in the

NfoFileNameExtensions

settings.

Example:

Assuming you have default settings and the

Resource

is:

D:\Movies\Falling Down.mkv

In this case, the NfoMovieMetadataExtractor would look for the following files to identify a

matching nfo-file

:

D:\Movies\Falling Down.nfo
D:\Movies\Falling Down.xml
D:\Movies\Falling Down.txt
D:\Movies\movie.nfo
D:\Movies\movie.xml
D:\Movies\movie.txt

The file names (and file name extensions) are not case sensitive.

Content of the Nfo-File

The

RootElementName

required for the NfoMovieMetadataExtractor is

movie

. for details on the

RootElementName

please see the general section on the content of

nfo-files

.

The NfoMovieMetadataExtractor has (in the NfoMovieReader class) a separate TryReadXyz method for every child element it can read, where Xyz is the child element name (despite the casing which in the

nfo-file

is always lower case). At the beginning of each TryReadXyz method in the source code there is a comment showing an example on how the content of this child element must be structured so that the NfoMovieMetadataExtractor can understand it.

Imported Attributes:

The following table contains the applied mapping of XML elements to

Attributes

in various

MediaItemAspects

.

If there are multiple XML elements in the "Imported XML Element" column separated by [priority 1], [priority 2], etc., then the value(s) of the XML element(s) under [priority 2] is/are only taken if there is no XML elemet present in the

nfo-file

that is listed under [piority 1] or there is no valid value for the XML element under [priority 1], etc.

If there are multiple XML elements in the "Imported XML Element" column not separated by [piority x] the behavior depends on whether or not the MediaLibrary can store multiple values for the respective

Attribute

. If so, all vaues are taken. If not, a random one is taken, unless specified otherwise in the table below.

Currenty, if a valid value was found for an XML element listed in the "Imported XML Element" column, any value that was stored in the respective

Attribute

by a MetadataExtractor applied before the NfoMovieMetadataExtractor is overwritten. If no valid value was found or there is no XML Element listed in the "Imported XML Element" column, the

Attribute

is not touched.

 

MediaItemAspect

Attribute

Imported XML Element

MediaAspect

Title

<title>Harry Potter und der Orden des Phönix</title>

MediaAspect

MimeType

 

MediaAspect

Size

 

MediaAspect

RecordingTime

[priority 1] <premiered>1994-09-14</premiered> <premiered>1994</premiered> If only a four digit year is contained, we Import 1 January of that year.   [priority 2] <year>1994-09-14</year> <year>1994</year> If only a four digit year is contained, we import 1 January of that year.

MediaAspect

Rating

 

MediaAspect

Comment

 

MediaAspect

PlayCount

[priority 1] <playcount>3</playcount> [priority 2] <watched>true</watched> <watched>false</watched> If true, a vaue of 1 is imported. If false, a value of 0 is imported.

MediaAspect

LastPlayed

<lastplayed>2013-10-08 21:46</lastplayed>

VideoAspect

Genres

<genre>Horror</genre> <genre>Horror / Trash</genre> <genres>   <genre>Horror</genre>   <genre>Horror / Trash</genre> </genres>

VideoAspect

Duration

 

VideoAspect

AudioStreamCount

 

VideoAspect

AudioEncoding

 

VideoAspect

AudioBitRate

 

VideoAspect

AudioLanguages

 

VideoAspect

VideoEncoding

 

VideoAspect

VideoBitRate

 

VideoAspect

Width

 

VideoAspect

Height

 

VideoAspect

AspectRatio

 

VideoAspect

FPS

 

VideoAspect

Actors

<actor>   <name>John Pyper-Ferguson</name> </actor>

VideoAspect

Directors

<director>Dennis Dugan</director>

VideoAspect

Writers

<credits>Gene Stupnitsky</credits> <credits>Gene Stupnitsky / Lee Eisenberg</credits>

VideoAspect

IsDVD

 

VideoAspect

StoryPlot

[priority 1] <plot>This movie tells a story about...</plot> [priority 2] <outline>This movie tells a story about...</outline>

MovieAspect

MovieName

<title>Harry Potter und der Orden des Phönix</title>

MovieAspect

OrigName

<originaltitle>Harry Potter and the Order of the Phoenix</originaltitle>

MovieAspect

TMDBID

[priority 1] <tmdbId>52913</tmdbId> <tmdbid>52913</tmdbid> [priority 2] <thmdb>52913<thmdb> [priority 3] <ids>   <entry>     <key>tmdbId</key>     <value>52913</value>   </entry> </ids>

MovieAspect

IMDBID

[priority 1] <id>tt0111161</id> [priority 2] <imdb>tt0111161</imdb> [priority 3] <ids>   <entry>     <key>imdbId</key>     <value>tt0111161</value>   </entry> </ids>

MovieAspect

CollectionName

<set order = "1">Harry Potter Collection</set> <set order = "1">   <setname>Harry Potter Collection</setname> </set> The order attribute in both cases is optional. If there are multiple sets in a nfo-file, we take the one with the lowest order. If there are multiple with the same lowest order or no order is specified, we take a random one.

MovieAspect

CollectionID

 

MovieAspect

Runtime

<runtime>120</runtime> <runtime>2h 00mn</runtime> <runtime>2h 00min</runtime> The simple number may contain decimal places and is interpreted as number of minues. A value of less than 1 second is then ignored.

MovieAspect

Certification

[priority 1] <certification>12</certification> <certification>DE:FSK 12</certification> <certification>DE:FSK 12 /  DE:FSK12 / DE:12 / DE:ab 12</certification> If multiple values are found (also multiple in one character separated string) only the first one is written into the MediaLibrary. [priority 2] <mpaa>12</mpaa> <mpaa>DE: FSK 12</mpaa> <mpaa>DE:FSK 12 / DE:FSK12 / DE:12 / DE:ab 12</mpaa> If multiple values are found (also multiple in one character separated string) only the first one is written into the MediaLibrary.

MovieAspect

Tagline

<tagline>This movie tells a story about...</tagline>

MovieAspect

Popularity

 

MovieAspect

Budget

 

MovieAspect

Revenue

 

MovieAspect

Score

 

MovieAspect

TotalRating

[priority 1] <rating>3.4</rating> A value of 0 is ignored. [priority 2] <ratings>   <rating moviedb="imdb">3.4</rating> </ratings> Vaues of 0 are ignored. There may be multiple <rating> child elements. The moviedb attribute may have any other value. If one with "imdb" is present, it is used. Otherwise a random one is taken.

MovieAspect

RatingCount

<votes>123</votes> This value is only written into the MediaLibrary if a valid <rating> element was found or the <ratings> element contains exactly one valid <rating> child element. A value of 0 is ignored.

ThumbnailLargeAspect

Thumbnail

<thumb>folder.jpg</thumb> The file must be located in the same directory as the nfo-file. <thumb>extrafanart\fanart1.jpg</thumb> <thumb>..\thumbs\fanart.jpg</thumb> The path must be relative to the parent directory of the nfo-file. <thumb>http://Image.tmdb.org/t/p/original/1...4aUa8LzzcK.jpg</thumb>

   

 

This page has no comments.