Mediaelch: Running Mediaelch rescans TVShows everytime

Created on 21 Jun 2019  路  29Comments  路  Source: Komet/MediaElch

Really annoying bug..

Running 20/6/2019 nightly rescans TVShows every time i start the program..

Windows 10 64 bit...

bug

All 29 comments

Hi,

thanks for reporting this issue. Really every TV show or only those for which you have "Show missing episodes" enabled? Or do you have "Reload on start" enabled for your tv show directory in your settings? :smiley:

All the TVShows..
Reload on start is not enabled..
this started to happen i think 2 or three versions before

Ok, thanks! :)
I'll dig into this issue on the weekend.

in 29/6/2019 nightly the bug is still there .

Hi,

as far as I can now tell, this seems to be the intended behavior?
I'm not the original author so I thought of this as a bug as well at first.

Why isn't this is bug?
On startup, the filescanner dialog is shown. But deleted shows or movies are not removed so it's not a full reload. Still, the dialog is quite annoying if you have more than a few tv shows or movies.
I can't say if this is a easy-to-fix issue but I think this is more of a feature-request than a bug at the moment. If new shows are scanned and added on startup and you have "reload on start" deactivated, then this is indeed a bug. Otherwise I'll mark this as a feature request. :)

Will this be fixed in the near future?
I'm already working on rewriting the movie file scanner so if it's easy to change, I'll fix this issue as well. But I can't promise anything as I din't have much time for MediaElch at the moment (I'm currently writing my Bachelor's thesis)

Regards,
Andre

Its a new BUG
it does a full scan of TV Shows..

Previous versions (4 versions i think) were not fully re-scanning tv shows, they were doing a "fast" re-scan.
Now its a full -slow- rescan its time a start Mediaelch

Ok, if this behavior has actually changed, then this is a bug.
So with version 2.4.2 this issue didn't occur? Does this only happen for TV shows or also for movies?

I'm currently trying to reproduce this issue but am not able to. Even with v2.4.2 and v2.4.0 the file scanner pops up and "loads" all media entries. But all shows aren't reloaded, i.e. re-scanned from disk. The same for v.2.6.1-dev :/

I think I found the issue. Thank you very much for being persistent on this issue :)
I'll push a fix ASAP.

The bug was introduced by #393. This surprises me because it was done automatically by a tool.

For interested developers

old code:

connect(Manager::instance()->tvShowFileSearcher(), SIGNAL(tvShowsLoaded(int)), ui->tvShowFilesWidget, SLOT(renewModel()));

new code with bug:

connect(Manager::instance()->tvShowFileSearcher(), &TvShowFileSearcher::tvShowsLoaded, ui->tvShowFilesWidget, &TvShowFilesWidget::renewModel);

renewModel takes a boolean as its first argument. If it's true, then reloading all tv shows is forced. Well, tvShowFileSearcher's first argument is a integer which is always > 0. And integers > 0 are implicitly converted to bool. So TV shows were always reloaded.

I thought that this issue wasn't restricted to TV shows so I searched in the wrong place. Again, @nkatsidis, thank you for opening this issue! I would have never found this issue without your bug report. :+1:

Regards,
Andre

Well,... apparently this fix caused issue #772
After looking at it again: Is this issue even fixed now?

@nkatsidis
I'll merge #773 after TravisCI has finished. Could you then test the latest nightly again? If your bug occurs again, I'll reopen this issue. Sorry for the inconvenience.

Windows 10 64bit . latest nightly..
When Mediaelch (latest) begins all the TVshows are scanned (like when i press the scrape button)

Running v 260 does not has this problem (TVShows are not scanned everytime i open the program)

Thank you. Seems fixing this issue causes another one...
I will have to refactor a lot of code and may have to rewrite the TV show view. This will take a while. :/

on 19/12/2019 version this bug is still there :)

:/

I haven't had time in the last 1.5 months to develop a lot for MediaElch.

Hi,

I had a look at it again. There are only a few functions which load TV show files from disk and none of them is called on MediaElch's startup...
I can't reproduce this issue with MediaElch v2.6.4 and the latest nightly.

What I found were a few memory leaks and other performance issues. One of them is fixed in #938. The file searcher definitely needs a cleanup.

Just to ask again: Is "Reload On Start" enabled for your TV show directory in MediaElch's settings?

"Reload On Start" is disabled for both movies and tvshows..
(tried the latest nightly... same behaviour)

I can confirm this.
Routine after clicking on the ME icon is to go and brew a cup of coffee while it scans through the entire TV collection.

Oh man. Thanks.

May I ask: how many shows do you have?

@psonnosp you use windows as well, right?

Edit:// Note for myself: maybe an issue with windows file paths and back slashes...

Yes I am, and X64. 馃槈

I have 368 shows and 11152 episodes. They are on a NAS that ME seem to have real issues communicating with for some odd reason, no speed issues otherwise but ME crawls through that NAS like a snail.

Thanks. Found the issue (at least one). I hate that I didn't find it earlier. I didn't notice that lag on my Windows machine because I only have few episodes for testing purpose and do my main development on Linux.

For some reason (maybe historically), MediaElch loads shows from disk when we either force a reload (the reload button is clicked) or no episodes are found in the internal database that are located under the show's directory (full path). It turns out, the path is stored Windows-style in the database, e.g. C:\path\to\show but we pass a "normalized" path into the database to query the number of episodes, e.g. C:/path/to/show. And the database jsut does a string comparison. Of course we get no episodes at all and try to load some from disk...

I'm sincerly sorry that this issue even arised. It happened because in a few places I changed the type of paths from a string to a more appropriate type (QDir) but still needed a conversion to string which "normalized" the paths. In a few places this didn't work. One was the concert folder (see #924) and the other one is this issue here.

Will fix this soon (probably not this weekend, though).

Please do its a really annoying bug ;)

No need to say sorry, it's a work in progress so shit is bound to happen sooner or later. 馃槈
Nothing but praise and thanks coming from this direction for sure 馃嵒

Ok, so here are the things that I plan on changing (and that I have partially already done locally) from a developer's point of view:

  • [x] Introduce DirectoryPath and FilePath classes to get rid of QDir and QString where a path is passed and to have more type safety (to avoid file paths being passed as directory paths and vise versa)

    • [x] DirectoryPath

    • [x] FIlePath

  • [x] Process (file) paths as "normalized" paths internally but show the native format to the User

    • [x] This needs proper testing

941 will fix this issue (unless I missed to test something). After this pull request, all paths will be processed in a "normalized" way (with /) but will be displayed on Windows using the native style (\). The download/import page needs some more work, though. That will come at a later change.

A new nightly will be available about 30min after #941 has been merged. Please test it, it should fix this issue. :smiley:

downloaded and installed latest nightly.. (4/4)
Problem is still there :)
when scanning finished i will close and run again if still is there

YES IT WORKS....
(as i ve said, i let it do a rescan of tvshows, then go to settings, save settings (just to be sure that reload on start is not selected)..
Rerun and VOILA..

THANK YOU :)

Thank you for your feedback!

Yes, the first run will reload the library because the paths in the internal database still have the non-normalized format. Second run should work.

Thank you for letting me know! 馃槂

and Thannk you for your great work and continuing support.. ;)

No problem. Btw, I found an issue in my latest change. I'll push a fix today. It only affects the Import dialog, though.

Works great but unfortunately this release made #878 even worse so can't use it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

txtsd picture txtsd  路  3Comments

psonnosp picture psonnosp  路  5Comments

mpwg picture mpwg  路  4Comments

Donatzsky picture Donatzsky  路  6Comments

aTosser picture aTosser  路  5Comments