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

importwatchedstate ignored in advancedsettings.xml from Kodi 20.0 #24909

Open
3 of 7 tasks
Vislike opened this issue Mar 28, 2024 · 3 comments · May be fixed by #24925
Open
3 of 7 tasks

importwatchedstate ignored in advancedsettings.xml from Kodi 20.0 #24909

Vislike opened this issue Mar 28, 2024 · 3 comments · May be fixed by #24925
Labels
Component: Database Triage: Has proposed fix Issue has been reproduced and has a pending proposed fix v20 Nexus v21 Omega

Comments

@Vislike
Copy link

Vislike commented Mar 28, 2024

Bug report

Describe the bug

My collection consist of movies with local .nfo files. I use it shared between multiple devices, both: Windows PCs and Raspberry Pis with libreelec.

My media manger allows me to mark movies as watched, this puts <playcount>1</playcount> in the .nfo file.
Back in Kodi 19.5 if i wanted the scanner to pick them up as watched i had to add advancedsettings.xml with importwatchedstate set to true.

This is no longer needed in Kodi 20. The scanner will always pick them up as watched if playcount is 1.

The problem thou is now i want a new install on a Raspberry Pi to have everything as unwatched. But adding the advancedsettings.xml with importwatchedstate set to false won't work.

I have also confirmed this on one of my windows installs that had importwatchedstate set to true, by changing it to false. And then renaming a movie with <playcount>1</playcount> but it still gets picked up by the scanner as watched.

If i change playcount to 0 and rename the movie again, then it will be picked up by the scanner as unwatched.

I have zero explanation for this behavior, curiously i had a look at the source AdvancedSettings.cpp and VideoInfoScanner.cpp, and it looks like it should work. But without being able to add more traces to the log and recompile i can't figure out the problem.

Expected Behavior

With importwatchedstate set to false in advancedsettings.xml i expect the movie to be added by the scanner as unwatched even with playcount set to 1.

Actual Behavior

Movie is always added as watched regardless of importwatchedstate set to true or false.

Possible Fix

Go back to Kodi 19.5 or not use the playcount in the .nfo.

To Reproduce

Steps to reproduce the behavior:

  1. Install Kodi 20.0+ (i have tested with 20.0, 20.5 and 21.0-RC2)
  2. Setup a Movie source with Local Information Only
  3. Add a Movie together with .nfo file with <playcount>1</playcount>
  4. Update library in Kodi, expect it to be picked up by scanner as watched.
  5. Create advancedsettings.xml in userdata folder with:
<advancedsettings version="1.0">
    <videolibrary>
        <importwatchedstate>false</importwatchedstate>
        <importresumepoint>false</importresumepoint>
    </videolibrary>
</advancedsettings>
  1. Rename Movie so it will be picked up by scanner again.
  2. Restart Kodi so it loads advancedsettings.xml
  3. Update library again, and it still gets picked up as watched

Debuglog

The debuglog can be found here:
https://paste.kodi.tv/zevonexuqe.kodi

Screenshots

Additional context or screenshots (if appropriate)

I think this thread might describe the same problem:
https://forum.kodi.tv/showthread.php?tid=375066

Your Environment

Used Operating system:

  • Android

  • iOS

  • tvOS

  • Linux

  • macOS

  • Windows

  • Windows UWP

  • Operating system version/name: Windows 10, Windows 11, Libreelec

  • Kodi version: 20.0, 20.5, 21.0-rc2

note: Once the issue is made we require you to update it with new information or Kodi versions should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.

@xbmc-gh-bot xbmc-gh-bot bot added the Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it label Mar 28, 2024
@KarellenX KarellenX added Component: Database Triage: Confirmed issue has been reproduced by a team member v20 Nexus v21 Omega and removed Triage: Needed (managed by bot!) issue that was just created and needs someone looking at it labels Mar 28, 2024
@KarellenX
Copy link
Member

Issue confirmed.
Import data ignored in v19, but imported in v20 and v21

The only change I am aware of is the flipping of the default setting so userdata is not discarded by default...
#20842

I am wondering if that change is correct? I don't see the use of {true} anywhere else in that file.

@neo1973
Copy link
Member

neo1973 commented Mar 31, 2024

On first look it seems like it's this location where the play count is used unconditionally:

int CVideoDatabase::AddFile(const CVideoInfoTag& details, const std::string& parentPath /* = "" */)
{
return AddFile(details.GetPath(), parentPath, details.m_dateAdded, details.GetPlayCount(),
details.m_lastPlayed);
}

This would have been introduced in #19367 commit 20c723a. I'll try to make a PR to fix this tomorrow.

@KarellenX
Copy link
Member

Thank you @neo1973

neo1973 added a commit to neo1973/xbmc that referenced this issue Mar 31, 2024
neo1973 added a commit to neo1973/xbmc that referenced this issue Mar 31, 2024
@neo1973 neo1973 added Triage: Has proposed fix Issue has been reproduced and has a pending proposed fix and removed Triage: Confirmed issue has been reproduced by a team member labels Mar 31, 2024
neo1973 added a commit to neo1973/xbmc that referenced this issue Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Database Triage: Has proposed fix Issue has been reproduced and has a pending proposed fix v20 Nexus v21 Omega
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants