xbmc / xbmc

Kodi is an award-winning free and open source home theater/media center software and entertainment hub for digital media. With its beautiful interface and powerful skinning engine, it's available for Android, BSD, Linux, macOS, iOS, tvOS and Windows.
https://kodi.tv/
Other
18.25k stars 6.28k forks source link

Clean library deleting everything if path substitution used #22526

Open alanmilinovic opened 1 year ago

alanmilinovic commented 1 year ago

Bug report

If I am using pathsubstitution all my movies and series are gone after performing "Clean library" via settings in kodi. Scanning and playing of files is working fine, though.

Expected Behavior

I am expecting that videos will not be cleaned and removed from the library if I am using path substitution. They should stay there.

Actual Behavior

All my videos are removed from the library although they do exist on the local drive.

Possible Fix

The only workaround is to remove pathsubstitution from the advancedsettings.xml file and correct sources.xml file to point to the right location on the local disk. But what is the point having pathsubstitution then in place as a feature?

To Reproduce

Steps to reproduce the behavior:

  1. This is what I have in my advancedsettings.xml file for the path substitution:
    <pathsubstitution>
    <substitute>
      <from>/home/pi/Videos</from>
      <to>/home/amilino/Videos</to>
    </substitute>
    </pathsubstitution>

    and this is what I have in sources.xml file:

        <source>
            <name>Movies</name>
            <path pathversion="1">/home/pi/Videos/Movies/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Series</name>
            <path pathversion="1">/home/pi/Videos/Series/</path>
            <allowsharing>true</allowsharing>
        </source>

    Before I was using RaspberryPi and did scraping of all movies and series into my library. Then after some time I moved everything to my other computer and wanted to avoid re-scanning of everything. So I just added path substitution and haven't touched sources.xml file. In both cases all videos were playable and new once were scanned and added to the library without any issues.

  2. After some time I wanted to clean up my library from videos that are removed from the disk and went to the Settings -> Media -> Library and clicked on "Clean library". Suddenly all my files are deleted from the library.

Your Environment

Used Operating system:

alanmilinovic commented 1 year ago

Any feedback?

alanmilinovic commented 1 year ago

Now I removed substitution from xml file, corrected the sources.xml, removed database files, scaned my library again and after clean library everything was again gone.

It looks like bug is more related to strm files usage and not to substitution.

I am a bit dissapointed that nobody is replying here. This is very serious bug for me as I have 4k movies and 1,5k series (not counting episodes). It is not very simple to clean up files manually.

github-actions[bot] commented 1 month ago

This issue is now marked stale because it has been open over a year without activity. Remove the stale label or add a comment to reset the stale state.