MovingPictures Import Export GUI

Discussion in 'MediaPortal 1 Plugins' started by thlucas, July 5, 2013.

  1. thlucas

    thlucas Portal Pro

    Joined:
    February 11, 2011
    Messages:
    133
    Likes Received:
    73
    Gender:
    Male
    Occupation:
    Computer Programmer
    Location:
    Omaha, NE
    Ratings:
    +83 / 0
    Home Country:
    United States of America United States of America
    This tool (not a plugin) allows a user to export data directly from the Moving Pictures SQLite database / file system locations to the movie library or a customized backup location. It can create individual XML files that contain information from the Moving Pictures database for storage in the movie file (or any other) location. These XML files contain all of the movie information and local media settings, as well as watched settings and custom filter (black / white) list settings. It will also copy all related cover art (cover, thumb, alternate covers, and backdrop) to the movie file (or any other) location.

    Please report any bugs / feature requests to this thread.



    Download / Wiki / Change Log Link

    https://www.team-mediaportal.com/extensions/tools/movingpictures-import-export-gui
     
    Last edited: July 18, 2013
    • Like Like x 4
    • Thank You! Thank You! x 3
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. cubii

    cubii Portal Pro

    Joined:
    November 1, 2006
    Messages:
    627
    Likes Received:
    32
    Ratings:
    +32 / 0
    Show System Specs
    Hi ,
    If i understand correctly, i can use this tool, save the xml files in the movies folders and after that i can reinstall mp and moving pictures and moving pictures will read these files?

    Or does it work only with this tool, so that i can use this import function to rewrite the database for moving pictures?
     
  4. thlucas

    thlucas Portal Pro

    Joined:
    February 11, 2011
    Messages:
    133
    Likes Received:
    73
    Gender:
    Male
    Occupation:
    Computer Programmer
    Location:
    Omaha, NE
    Ratings:
    +83 / 0
    Home Country:
    United States of America United States of America
    Hi cubii - the Moving Pictures importer will not currently read these files, but an importer script could be made to read the base movie details from the XML; note that this would NOT read the watched settings or custom filter settings, as I don't think the Moving Pictures importer scripting is that advanced (MP authors correct me if I'm wrong on that).

    The files were made to work with this particular tool - the import function would then be used to insert movie details, watched settings, custom filters, etc directly into the Moving Pictures SQLite database, as well as copy artwork to the appropriate locations.[DOUBLEPOST=1373036938][/DOUBLEPOST]Here's an example of the generated XML - for the movie "Cars" (2006):

    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <MPXml MovieBasePath="D:\DVD Library\Movies\Cars\" Version="1" MPVersion="1.5.1.1487">
    3.   <MovieInfo>
    4.     <Title>Cars</Title>
    5.     <Year>2006</Year>
    6.     <IMDBId>tt0317219</IMDBId>
    7.     <Summary>While traveling to California for the dispute of the final race of the Piston Cup against The King and Chick Hicks, the famous Lightning McQueen accidentally damages the road of the small town Radiator Springs and is sentenced to repair it. Lightning McQueen has to work hard and finds friendship and love in the simple locals, changing its values during his stay in the small town and becoming a true winner.</Summary>
    8.     <RunTime>117</RunTime>
    9.     <CoverFullPath>C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\MovingPictures\Covers\FullSize\{Cars} [-1380920179].jpg</CoverFullPath>
    10.     <BackdropFullPath>C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\MovingPictures\Backdrops\FullSize\{Cars} [-820045903].jpg</BackdropFullPath>
    11.     <CoverThumbFullPath>C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\MovingPictures\Covers\Thumbs\{Cars} [-1380920179].jpg</CoverThumbFullPath>
    12.     <SortBy>cars</SortBy>
    13.     <Certification>G</Certification>
    14.     <Language>English</Language>
    15.     <TagLine>Our Cars Speak For Themselves.</TagLine>
    16.     <Score>7.3</Score>
    17.     <Popularity>100</Popularity>
    18.     <DateAdded>2013-06-12 16:55:47Z</DateAdded>
    19.     <OriginalDirectoryName> </OriginalDirectoryName>
    20.     <PrimarySourceScriptName>imdb.com</PrimarySourceScriptName>
    21.     <DetailsUrl>http://www.imdb.com/title/tt0317219</DetailsUrl>
    22.     <MpsId />
    23.     <Actors>
    24.       <Item Value="Owen Wilson" />
    25.       <Item Value="Paul Newman" />
    26.       <Item Value="Bonnie Hunt" />
    27.       <Item Value="Larry The Cable Guy" />
    28.       <Item Value="Cheech Marin" />
    29.       <Item Value="Tony Shalhoub" />
    30.       <Item Value="Guido Quaroni" />
    31.       <Item Value="Jenifer Lewis" />
    32.       <Item Value="Paul Dooley" />
    33.       <Item Value="Michael Wallis" />
    34.       <Item Value="George Carlin" />
    35.       <Item Value="Katherine Helmond" />
    36.       <Item Value="John Ratzenberger" />
    37.       <Item Value="Michael Keaton" />
    38.     </Actors>
    39.     <AlternateTitles>
    40.       <Item Value="Bilar" />
    41.       <Item Value="Cars - Motori Ruggenti" />
    42.       <Item Value="Carros" />
    43.       <Item Value="Autot" />
    44.     </AlternateTitles>
    45.     <Directors>
    46.       <Item Value="John Lasseter" />
    47.       <Item Value="Joe Ranft" />
    48.     </Directors>
    49.     <Writers>
    50.       <Item Value="Dan Fogelman" />
    51.       <Item Value="Joe Ranft" />
    52.       <Item Value="John Lasseter" />
    53.       <Item Value="Jorgen Klubien" />
    54.       <Item Value="Kiel Murray" />
    55.       <Item Value="Phil Lorin" />
    56.     </Writers>
    57.     <Genres>
    58.       <Item Value="Animation" />
    59.       <Item Value="Adventure" />
    60.       <Item Value="Comedy" />
    61.       <Item Value="Family" />
    62.       <Item Value="Sport" />
    63.     </Genres>
    64.     <AlternateCovers>
    65.       <Item Value="C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\MovingPictures\Covers\FullSize\{Cars} [-1380920179].jpg" />
    66.       <Item Value="C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\MovingPictures\Covers\FullSize\{Cars} [850970106].jpg" />
    67.       <Item Value="C:\ProgramData\Team MediaPortal\MediaPortal\Thumbs\MovingPictures\Covers\FullSize\{Cars} [-666634910].jpg" />
    68.     </AlternateCovers>
    69.     <Studios>
    70.       <Item Value="Pixar Animation Studios" />
    71.       <Item Value="Walt Disney Pictures" />
    72.     </Studios>
    73.   </MovieInfo>
    74.   <LocalMedia>
    75.     <MediaLabel>New Volume</MediaLabel>
    76.     <FullPath>D:\DVD Library\Movies\Cars\VIDEO_TS\Cars.avi</FullPath>
    77.     <OriginalFileName> </OriginalFileName>
    78.     <VolumeSerial>88BA9655</VolumeSerial>
    79.     <DiscId />
    80.     <FileHash>41cf62a76a8ec33c</FileHash>
    81.     <Part>1</Part>
    82.     <Duration>3143</Duration>
    83.     <Ignored>false</Ignored>
    84.     <ImportPath>
    85.       <Path>D:\DVD Library\Movies\</Path>
    86.       <InternallyManaged>false</InternallyManaged>
    87.       <Replaced>false</Replaced>
    88.     </ImportPath>
    89.     <VideoWidth>256</VideoWidth>
    90.     <VideoHeight>240</VideoHeight>
    91.     <VideoResolution>SD</VideoResolution>
    92.     <VideoCodec>iv41</VideoCodec>
    93.     <VideoFrameRate>35</VideoFrameRate>
    94.     <VideoAspectRatio>widescreen</VideoAspectRatio>
    95.     <VideoFormat>File</VideoFormat>
    96.     <AudioCodec> </AudioCodec>
    97.     <AudioChannels>0</AudioChannels>
    98.     <HasSubTitles>false</HasSubTitles>
    99.   </LocalMedia>
    100.   <UserSettings>
    101.     <UserSettingsItem>
    102.       <UserName>Default User</UserName>
    103.       <UserRating />
    104.       <Watched>1</Watched>
    105.       <ResumePart>0</ResumePart>
    106.       <ResumeTime>0</ResumeTime>
    107.       <ResumeData />
    108.     </UserSettingsItem>
    109.   </UserSettings>
    110.   <WatchedHistory>
    111.     <WatchedHistoryItem>
    112.       <UserName>Default User</UserName>
    113.       <DateWatched>2013-06-12 17:06:20Z</DateWatched>
    114.     </WatchedHistoryItem>
    115.   </WatchedHistory>
    116.   <FilterWhiteList>
    117.     <FilterWhiteListItem>
    118.       <FilterName>My SubTitle Level 02</FilterName>
    119.       <CriteriaGrouping>ALL</CriteriaGrouping>
    120.       <GenericType />
    121.       <Nodes>
    122.         <Node>
    123.           <Name>My SubTitle Level 02</Name>
    124.           <ParentName>My Top Title With SubTitles</ParentName>
    125.           <MenuName />
    126.           <AutoGenerated>false</AutoGenerated>
    127.           <DynamicNode>false</DynamicNode>
    128.           <BasicFilteringField />
    129.           <BasicFilteringRelation />
    130.           <AdditionalSettings />
    131.           <SortPosition>0</SortPosition>
    132.         </Node>
    133.         <Node>
    134.           <Name>My Top Title With SubTitles</Name>
    135.           <ParentName />
    136.           <MenuName>Categories Menu</MenuName>
    137.           <AutoGenerated>false</AutoGenerated>
    138.           <DynamicNode>false</DynamicNode>
    139.           <BasicFilteringField />
    140.           <BasicFilteringRelation />
    141.           <AdditionalSettings />
    142.           <SortPosition>8</SortPosition>
    143.         </Node>
    144.       </Nodes>
    145.     </FilterWhiteListItem>
    146.   </FilterWhiteList>
    147.   <FilterBlackList>
    148.     <FilterBlackListItem>
    149.       <FilterName>My Top Title With SubTitles</FilterName>
    150.       <CriteriaGrouping>ALL</CriteriaGrouping>
    151.       <GenericType />
    152.       <Nodes>
    153.         <Node>
    154.           <Name>My Top Title With SubTitles</Name>
    155.           <ParentName />
    156.           <MenuName>Categories Menu</MenuName>
    157.           <AutoGenerated>false</AutoGenerated>
    158.           <DynamicNode>false</DynamicNode>
    159.           <BasicFilteringField />
    160.           <BasicFilteringRelation />
    161.           <AdditionalSettings />
    162.           <SortPosition>8</SortPosition>
    163.         </Node>
    164.       </Nodes>
    165.     </FilterBlackListItem>
    166.   </FilterBlackList>
    167.   <SourceMovieInfo>
    168.     <SourceMovieInfoItem>
    169.       <Identifier>tt2024432</Identifier>
    170.       <SourceInfo>
    171.         <SelectedScriptName>imdb.com</SelectedScriptName>
    172.       </SourceInfo>
    173.     </SourceMovieInfoItem>
    174.     <SourceMovieInfoItem>
    175.       <Identifier>109431</Identifier>
    176.       <SourceInfo />
    177.     </SourceMovieInfoItem>
    178.     <SourceMovieInfoItem>
    179.       <Identifier>tt0317219</Identifier>
    180.       <SourceInfo>
    181.         <SelectedScriptName>imdb.com</SelectedScriptName>
    182.       </SourceInfo>
    183.     </SourceMovieInfoItem>
    184.     <SourceMovieInfoItem>
    185.       <Identifier>920</Identifier>
    186.       <SourceInfo />
    187.     </SourceMovieInfoItem>
    188.   </SourceMovieInfo>
    189. </MPXml>
     
    Last edited: July 5, 2013
  5. thlucas

    thlucas Portal Pro

    Joined:
    February 11, 2011
    Messages:
    133
    Likes Received:
    73
    Gender:
    Male
    Occupation:
    Computer Programmer
    Location:
    Omaha, NE
    Ratings:
    +83 / 0
    Home Country:
    United States of America United States of America
    Updated tool to version 1.0.2.0 - added import capability, as well as detailed Excel reporting.

    I marked this as a "Testing" release, as I have tested it as much as one can on MY collection of 725+ movies. My collection is mostly DVD rips (no BlueRay), with the rips residing in a file structure of "C:\Movies\movietitle (year)\VIDEO_TS\moviefile.IFO". I also tested for movie folder structures where ALL movies reside in the SAME folder structure. As always, please backup your MovingPictures.db3 database BEFORE using the import functionality. As this is a "Testing" release, there could be some unexpected behavior when writing directly to the MP database. I'm pretty anal about testing, so I'm confident that it works correctly for MY collection - but I've only tested it with MY collection, so buyer beware.

    I would like to get some volunteers to send me their MovingPictures.db3 database to see how it works for different collections. I would especially be interested in collections that contain multiple filter settings. The number of movies in the collection doesn't matter, as the tool will handle pretty much anything - only limitation is memory / disk space.

    Any volunteers? Please PM me if interested.
     
  6. kszabo
    • Premium Supporter

    kszabo MP Donator

    Joined:
    December 6, 2007
    Messages:
    796
    Likes Received:
    76
    Location:
    Germany, Bayern
    Ratings:
    +87 / 1
    Home Country:
    Hungary Hungary
    Show System Specs
    very nice job, even without trying this.

    I always simpy backuped my movingpictures.db file and after a new install copied back manually.... never lost any settings (OK, the covers were loaded automatically again, but who cares). What would be the advantage of your solution compared to my simple and straitforward method?
     
    Last edited: August 12, 2013
  7. thlucas

    thlucas Portal Pro

    Joined:
    February 11, 2011
    Messages:
    133
    Likes Received:
    73
    Gender:
    Male
    Occupation:
    Computer Programmer
    Location:
    Omaha, NE
    Ratings:
    +83 / 0
    Home Country:
    United States of America United States of America
    I tried that backup approach myself at first, which works if I don't watch very many movies or manually add movies to white / black filters. I even automated the backup to copy the DB file every week. I found that when I went to restore after a crash / reinstall, I would forget to re-flag movies with watched status and set the filters. As for covers, I also have alot of custom covers that I use. I also have a few covers that always download the incorrect cover art, and it's a pain to go i nand reset them.

    Another advantage is that I can store all of the cover art in the movie location. This allows Windows Media Center to pick up the cover art (ie folder.jpg) when displaying movies in the WMC7 interface. I primarily use MediaPortal for watching movies, but also use WMC7 once in awhile (don't hate me).

    The tool also has the capability of restoring an entire collection that was backed up on one machine, to a folder structure on another machine. For example, I have an HTPC1 downstairs that uses the following folder structure to store my movies:
    E:\Movies\movie title
    F:\Movies\movie title
    G:\Movies\movie title
    H:\Movies\movie title

    I have a an HTPC2 upstairs that uses the following structure to store its movies. Note that HTPC2 has a larger hard drive, so I only need 1 drive instead of 4 drives to house my collection:
    M:\Movies\movie title

    In this example, the HTPC2 drive M: will contain all content from HTPC1 drives E:, F:, G:, and H:. By using mapped paths, I can export my collection of movies from HTPC1 to a common location. I can then use import path mapping when importing the collection to HTPC2, which will translate all of the HTPC1 file references to HTPC2 equivalents. This makes it easier to maintain multiple images of MediaPortal.

    I guess the final thought would be the tool may not be right for everyone, but it definitely fits my needs and hopefully will fit someone else's too.

    Cheers!
     
    • Thank You! Thank You! x 1
  8. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    would it not be better to store the images in the folder (or subfolder) with the movie and have the xml reference a relative path from the xml/movie file location. otherwise the 'backup function' of the artwork is kinda pointless because it relies on the thumbs folder being present, if you rely on the thumbs folder being present then you might as well rely on the database folder being present as well, which makes the whole 'backup' or image transfer pointless :)

    the importer tool would have the option to repopulate the thumbs folder on import
     
    Last edited: August 13, 2013
  9. thlucas

    thlucas Portal Pro

    Joined:
    February 11, 2011
    Messages:
    133
    Likes Received:
    73
    Gender:
    Male
    Occupation:
    Computer Programmer
    Location:
    Omaha, NE
    Ratings:
    +83 / 0
    Home Country:
    United States of America United States of America
    The art paths (and others) contained in the XML are really meaningless, as it will re-resolve all path-related details from where it finds the XML file. This "path resolve" processing takes place when clicking on the "Find Movies" option to search for Movie information XML files to import; fully-qualified paths are formulated using the various MovingPictures settings values, which point to the location of where the files will be copied to.

    Also note that you can export to the movie file location, or to a custom folder location. The custom folder location can also contain movie information parameters such as title, imdb id, and year.

    Also, the importer process has not only the option to import thumb images, but also the main cover, backdrop, and alternate covers. So if you only need to restore backdrops lets say, you can do that.
     
  10. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    ok i haven't tried your plugin I just felt that if you are storing db info locally with the movie you should also store the images locally with the movie. maybe you already do this, it was a bit unclear from your answer. this was only a suggestion.
     
    Last edited: August 13, 2013
  11. thlucas

    thlucas Portal Pro

    Joined:
    February 11, 2011
    Messages:
    133
    Likes Received:
    73
    Gender:
    Male
    Occupation:
    Computer Programmer
    Location:
    Omaha, NE
    Ratings:
    +83 / 0
    Home Country:
    United States of America United States of America
    To be clear, the images are stored in the same data location as the movie information XML. The data location can be either a custom folder, or where the movie file (ie VIDEO_TS.IFO) resides. The folder location as well as file names can contain movie information parameters such as title, imdb id, and year, so any of the following structures are possible:

    Scenario 1 - where the movie file resides.
    C:\Movies\Cars (2009)\MovingPictures.xml
    C:\Movies\Cars (2009)\Folder.jpg
    C:\Movies\Cars (2009)\Backdrop.jpg
    C:\Movies\Cars (2009)\Cover Alt 001.jpg
    C:\Movies\Cars (2009)\Cover Alt 002.jpg
    C:\Movies\Cars (2009)\Cover Alt 003.jpg
    C:\Movies\Cars (2009)\VIDEO_TS\VIDEO.IFO

    Scenario 2 - custom data location with movie info in seperate folders.
    C:\Movie Data Backup\Cars (2009)\MovingPictures.xml
    C:\Movie Data Backup\Cars (2009)\Folder.jpg
    C:\Movie Data Backup\Cars (2009)\Backdrop.jpg
    C:\Movie Data Backup\Cars (2009)\Cover Alt 001.jpg
    C:\Movie Data Backup\Cars (2009)\Cover Alt 002.jpg
    C:\Movie Data Backup\Cars (2009)\Cover Alt 003.jpg

    Scenario 3 - custom data location with movie info in file names in 1 folder.
    C:\Movie Data Backup HTPC1\Cars (2009).xml
    C:\Movie Data Backup HTPC1\Cars (2009) Folder.jpg
    C:\Movie Data Backup HTPC1\Cars (2009) Backdrop.jpg
    C:\Movie Data Backup HTPC1\Cars (2009) Cover Alt 001.jpg
    C:\Movie Data Backup HTPC1\Cars (2009) Cover Alt 002.jpg
    C:\Movie Data Backup HTPC1\Cars (2009) Cover Alt 003.jpg

    Hope it clears things up.
     
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!