Import-export library: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(3 intermediate revisions by the same user not shown)
Line 28: Line 28:
*Music Videos- Metadata and artwork
*Music Videos- Metadata and artwork


By adding suitable code to ''advancedsettings.xml'', you are able to further modify which data is exported and imported. The following three tags are availble... {{small see also|Advancedsettings.xml}}
<pre>
<advancedsettings>
    <videolibrary>
      <exportautothumbs>false</exportautothumbs>  <!-- Export auto-generated thumbs. Default = false. Change to true to allow export -->
      <importwatchedstate>false</importwatchedstate>  <!-- Import Last Played and Play Counts. Default = false. Change to true to allow import -->
      <importresumepoint>false</importresumepoint>  <!-- Import Resume Points. Default = false. Change to true to allow import -->
    </videolibrary>
</advancedsettings>
</pre>


Upon selection of the Export Library setting, you will be required to choose the Export method as depicted in the second image below. Continue reading for an explanation of the options.
 
In settings, select '''Export library''' as shown in the first image. Ensure you choose the option in the Video library section (top) and not the Music library section (bottom). You will be required to choose the Export method as depicted in the second image. Continue reading for an explanation of the options.


<gallery widths="700" heights="400">
<gallery widths="700" heights="400">
Line 186: Line 197:
Kodi has the ability to get the import movie library information from "[http://www.mymovies.dk/ My Movies]" via the mymovies.xml files that it generates, these mymovies.xml are checked after the movie.nfo file.-->
Kodi has the ability to get the import movie library information from "[http://www.mymovies.dk/ My Movies]" via the mymovies.xml files that it generates, these mymovies.xml are checked after the movie.nfo file.-->


= Other Options =
By adding suitable code to ''advancedsettings.xml'', you are able to further modify which data is imported. {{small see also|Advancedsettings.xml}}
<videolibrary>
  <exportautothumbs>false</exportautothumbs>  -- export auto-generated thumbs. Defaults to false --
  <importwatchedstate>false</importwatchedstate>  -- import previously exported playdate and playcount from .nfo files. Defaults to false --
  <importresumepoint>false</importresumepoint>  -- import previously exported resume point from .nfo files. Defaults to false --
</videolibrary>





Revision as of 09:05, 2 May 2018

Home icon grey.png   ▶ Video Library
▶ Music Library
▶ Import-export library


Introduction

Kodi offers the ability to import and export metadata and artwork manually into/from the Media Library, as well as importing media info automatically from .nfo files.


Kodi has the option to both Export and Import its Video database. These options may be used for a number of reasons including the following more popular ones:

  • Perform database backup and recovery (This is not the only method for backup and recovery)
  • Reorganization of data or eliminate database fragmentation (export, clean/remove database, re-import)
  • Move data between Kodi databases on different platforms (eg Widows to Linux)


It also has an Export and Import option for some parts of the Music database, however the main data in the music library comes from metadata embedded in the music files, and the export facility does not backup this data at all. Likewise import will not populate an empty db. What is imported and exported is any additional album artist and album information that has been previously scraped from NFO files or online sources. It's uses are limited, but it does enable the user to capture data that they have scraped online, including any manual choices they made, in a form that can be transfered.

Various options are available to control what objects are exported or imported.


Video Library Export / Import

The option is accessed via the Settings menu as detailed in the first image.

This option will Export and Import the following media classes:

  • Movies- Metadata and artwork
  • TV Shows- Metadata and artwork
  • Music Videos- Metadata and artwork

By adding suitable code to advancedsettings.xml, you are able to further modify which data is exported and imported. The following three tags are availble... See also: Advancedsettings.xml

 <advancedsettings>
    <videolibrary>
       <exportautothumbs>false</exportautothumbs>  <!-- Export auto-generated thumbs. Default = false. Change to true to allow export -->
       <importwatchedstate>false</importwatchedstate>  <!-- Import Last Played and Play Counts. Default = false. Change to true to allow import -->
       <importresumepoint>false</importresumepoint>  <!-- Import Resume Points. Default = false. Change to true to allow import -->
    </videolibrary>
 </advancedsettings>


In settings, select Export library as shown in the first image. Ensure you choose the option in the Video library section (top) and not the Music library section (bottom). You will be required to choose the Export method as depicted in the second image. Continue reading for an explanation of the options.


Export to Separate Files

This option will export the metadata stored in the database and save it into a nfo file. It will be saved to the same directory where that particular Movie/TV Show/Music Video is located. This is a good example where Movies and TV Show episodes would benefit from being in their own directory.

After selecting Separate, you will then be asked if you would like to Export thumbnails and fanart?. This will export the Fanart, Posters, Banners, Episode Thumbs and Music Video Posters.

  • Choosing Yes will save a copy of the cached artwork into the Movie, TV Show, TV Show Episode and Music Video directory alongside the video file and the nfo file.
  • Choosing No will not export the artwork

The next option is Export Actors Thumbs.

  • Choosing Yes will export a copy of the Actors artwork in a directory named .actors
  • Choosing No will not export a copy of the Actors artwork

The final option is Overwrite Old Files.

  • Choosing Yes will overwrite the existing nfo files and artwork. This is useful if you have modified your metadata such as changed the artwork, created or modified movie sets, etc. Any movies/tv shows/music videos that were not present since the last Export will have the nfo and artwork exported to their directory.
  • Choosing No will add nfo files and artwork to those movies/tv shows/music videos that do not already have them. eg they are new and added after the last export. If you made changes to a movie/tv show/music video that already has an nfo created, these changes will not be exported.
  • If this is the first time this option has been run and/or you have no nfo files and artwork saved in your movie/tv show/music video directories, both choices will have the same result.

The Export will commence immediately once the final option is selected. An onscreen progress bar will indicate progress.


Export to Single File

LibExp06.jpg

Note: Do not use this option if you have changed, or intend to change, the filenames or paths of your video files after running the Export. For example, renaming movie files, moving files between Sources or to new Sources. Doing so will leave you with a dead library. The data will be imported but Kodi will not be able to locate the moved files. Use the Separate files method instead.

This option will export all metadata and all artwork to a single directory, to a location nominated by the user, as follows:

  • The only option available is the save location which you will be prompted and required to enter
  • Kodi will create a directory in your selected location named xbmc_videodb_yyyy-mm-dd
  • Library metadata will be saved into a single videodb.xml file within that directory
  • Artwork will be saved within multiple sub-directories according to type
  • Subsequent exports will not overwrite existing Single File exports
  • Subsequent exports are full exports. They are not incremental exports.

Note: Some users may find the single file export problematic in Frodo and higher, due to an issue with artwork. The export process changes the artwork location URL to the folder location of the export, which causes an issue if you need to refresh the image. To fix, you will need to manually source the image in the Information page of the Movie/TV show


Import

If you exported your library using the Export to Separate Files option, then you must use the normal scraping process to re-import the data. See also: Updating_or_removing_videos

If you exported your library using the Export to Single File option, you will need to use this method to import the data as follows

  • Select Import to commence the import process
  • Locate the the directory for your previously saved single file export
  • If you have multiple single file exports, ensure you have selected the correct one.
  • Select Ok. A progress bar will be displayed to indicate progress
  • Once complete, your library should be functional again

Be aware that if you have removed movies or tv shows or music videos since the export, the metadata for those movies, tv shows and music videos will be re-imported into the library. You will need to run a Clean Library to remove them. This option is located just above the Export entry.


Music Library Export / Import

The option is accessed via the Settings menu as detailed in the first image. It is on the same page as the Video Export option. You may have to scroll down to locate it. Upon selection of the Export Library setting, you will be required to choose the Export method as depicted in the second image below. The process is similar to the Video Export and Import instructions above, but there are some slight variances. Continue reading for an explanation of the options.


Export to Separate Files

This option will export any previously scraped album artist and album information and save it into a nfo file in the locations as follows:

  • Artist nfo file and artwork will be saved in the Artist directory
  • Album nfo file and artwork will be saved in the Album directory
  • If the music source has not been scraped, no nfo file will be written
  • Only Album and Album Artist data is exported. Song artists, those that do not have albums and only appear featured on tracks or on "Various Artists" compilation albums, are not included
  • Song data such as rating, play count, and last time played are not included either.

Note: There are weaknesses in the way that Kodi determines the location of the artist directory. It looks for the folder that is common to all the songs with that album artist, the name of that folder is irrelevent. If you have multiple albums by an artist all under an artist folder then this works perfectly. However the algorithm does not work for collaboration albums, those that have more than one album artist e.g. "Riding with the King" by Eric Clapton and BB King, or classical music with composer, orchestra and conductor given as the album artist. It also gets confused when you have only one album by an artist, and takes the album directory as the artist directory. Also if you have not kept all songs by an artist under a unique folder, then the artist directory will probably be mis-identified. The result for export is that the artist.NFO file goes somewhere unexpected, and that location may not be unique, so the NFO will contain the artist information from the last album artist exported

The music section of v18 is undergoing a major overhaul and this issue will be resolved with the release of v18


After selecting Separate, you will then be asked if you would like to Export thumbnails and fanart?. This will export the Artist and album artwork.

  • Choosing Yes will export a copy of the cached artwork into the appropriate Artist and Album directory.
  • Choosing No will not export the artwork

The final option is Overwrite Old Files.

  • Choosing Yes will overwrite the existing nfo files and artwork. This is useful if you have scraped album or album artist information online that you want to replace any locally held data, or changed the artwork. Any Albums/Artists that were not present since the last Export will have the nfo and artwork exported to their directory.
  • Choosing No will add nfo files and artwork to those Albums/Artists that do not already have them. eg they are new and added after the last export. If you have modified data of an Artist or Album that was previously exported, this change will not be exported.
  • If this is the first time this option has been run and/or you have no nfo files and artwork saved in your Artist/Album directories, both choices will have the same result.

The Export will commence immediately once the final option is selected. An onscreen progress bar will indicate progress.


Export to Single File

LibExp06.jpg

This option will export previously scraped album artists and album information to a single file, to a location nominated by the user, as follows:

  • Kodi will create a file in your selected location named musicdb.xml
  • The only option available is the save location which you will be prompted and required to enter

Be aware of the following caveats:

  • Export will write an empty .xml file if none of the album artists or albums have been scraped.
  • Artwork will not be saved
  • Subsequent exports will overwrite the existing Single File exports



Import

If you exported your library using the Export to Separate Files option, then you must use the normal scraping process to re-import the data.

If you exported your library using the Export to Single File option, you will need to use this method to import the data as follows

  • Select Import to commence the import process
  • Locate the the directory for your previously saved single file export
  • Select the musicdb.xml file
  • The Import process will commence immediately
  • Once complete, your library should be functional again

Be aware:

  • if you have removed Albums or Artists since the export, the metadata for those Albums and Album Artists will be re-imported into the library. You will need to run a Clean Library to remove them. This option is located just above the Export entry.


Music Videos

The Music Videos Export/Import is controlled and run by the Video Library Export/Import. Running the Export/Import for Movies and TV Shows, will also run the Export/Import for Music Videos at the same time as they share the same library.

Note: When using the Single File export in v17, there is a glitch where the artwork for music videos is not saved in the musicvideos directory, rather it is saved in the movies directory along with the Movies artwork

Note: This issue has been fixed for v18 onwards

For an explanation of what artwork is exported and imported See: Music_Video_artwork


Pictures

The Pictures section of Kodi is simply an Image Browser. It does not use a library database. Therefore you cannot Import or Export pictures.



Return to top