Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] repeated loading when use fuzzydir.lua #3

Closed
dyphire opened this issue Apr 4, 2022 · 9 comments
Closed

[Bug] repeated loading when use fuzzydir.lua #3

dyphire opened this issue Apr 4, 2022 · 9 comments

Comments

@dyphire
Copy link
Contributor

dyphire commented Apr 4, 2022

As I mentioned there: #2

For the following folder structure:

│   1.mkv
│   1.srt
└───anyname*
    │   1_en.srt
    └───anyname*
        │   1_zh.srt

Before use the script of fuzzydir.lua: mpv only had one 1.srt.
After use the script of fuzzydir.lua: mpv had two 1.srt.

The same is true for audio files.

As in the example, this issue only happen in the same directory of the video file. Normal loading in subdirectory.
I think the same file should only be loaded once on mpv.

@dyphire dyphire changed the title [Bug] repeated loading of fuzzydir.lua [Bug] repeated loading when use fuzzydir.lua Apr 4, 2022
@sibwaf
Copy link
Owner

sibwaf commented Apr 4, 2022

This script was made to add path discovery support to mpv, not to select the correct file for the user. It is also not a bug as far as I'm concerned, as the "vanilla" mpv has the same behavior.

Config (the script is NOT loaded):
sub-file-paths=subs;subs/moresubs (for Windows; replace the semicolon with a colon on other platforms)

Directory structure:

|  video.mkv
|  video_1.ass
|  subs
   |  video_2.ass
   |  moresubs
      |  video_3.ass

mpv's console output:

     Subs  --sid=3 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_1.ass' (ass) (external)
     Subs  --sid=4 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_2.ass' (ass) (external)
     Subs  --sid=5 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_3.ass' (ass) (external)

The "only one file was loaded" behavior before is probably caused by a non-configured or misconfigured sub-file-paths.

@dyphire
Copy link
Contributor Author

dyphire commented Apr 4, 2022

You understand wrong. I don't mean that mpv will only load one file. Instead, the same file is loaded only once.

For your example, using the script of fuzzydir.lua will get the following results:

     Subs  --sid=3 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_1.ass' (ass) (external)
     Subs  --sid=4 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_1.ass' (ass) (external)
     Subs  --sid=5 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_2.ass' (ass) (external)
     Subs  --sid=6 '[Beatrice-Raws] Byousoku 5 Centimeter [BDRip 1920x1080 x264 FLAC]_3.ass' (ass) (external)

@sibwaf
Copy link
Owner

sibwaf commented Apr 4, 2022

Yep, managed to reproduce the bug. I'll take a look, thanks for the report!

@dyphire
Copy link
Contributor Author

dyphire commented Apr 4, 2022

not use fuzzydir.lua

use fuzzydir.lua

Now you can see the problem of expected behavior more intuitively. The script is repeatedly loading the same file in the same directory of the video. Again, subdirectories are expected to behave normally.

@dyphire
Copy link
Contributor Author

dyphire commented Apr 7, 2022

The latest commit has fixed this issue and the script is now working properly.

@dyphire dyphire closed this as completed Apr 7, 2022
@dyphire
Copy link
Contributor Author

dyphire commented Apr 7, 2022

Maybe there should be a threshold to limit the amount of discovered paths or something.

I also want to know another thing. Will this be realized?

@sibwaf
Copy link
Owner

sibwaf commented Apr 7, 2022

Hm, I'm not sure to be honest. Feels a bit too hackish, so I'd like to debug it before making any decisions. Could you share any info on how to reproduce the crash (in a new issue)? max_search_depth, sub-file-paths and directory structure should probably be enough.

@dyphire
Copy link
Contributor Author

dyphire commented Apr 7, 2022

Could you share any info on how to reproduce the crash (in a new issue)?

Sorry, I don't have the conditions to reproduce the relevant issues.

This issue was reported to me by a friend of mine. He plays files through SMB protocol, He gets a very bad delayed loading experience when uses this script with thousands of files in the video directory.

It can be said that this problem is actually caused by poor document management habits.
Therefore, it is understandable even if the relevant optimization is not implemented.

@sibwaf
Copy link
Owner

sibwaf commented Apr 7, 2022

Well, either way just having the script cause problems isn't good, there should be a fail-safe of sorts. Made #4, I'll look into it someday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants