-
-
Notifications
You must be signed in to change notification settings - Fork 1
Also filter out watched non db items #6
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
Conversation
WalkthroughAdd percent-based removal for non-database video items in playback removal logic: compute percent_played from resumetime/totaltime and compare to Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant PB as playback.remove_watched_playbacks
participant DB as Kodi DB
participant Util as get_advancedsetting
Caller->>PB: remove_watched_playbacks(items)
alt Item has dbid
PB->>DB: get_playcount(type, dbid)
DB-->>PB: playcount
alt playcount > 0
PB->>PB: add path to paths_to_remove (DB-based)
else
PB->>PB: keep item
end
else No dbid, has resumetime & totaltime
PB->>Util: get_advancedsetting('video/playcountminimumpercent')
Util-->>PB: threshold
PB->>PB: percent_played = (resumetime / totaltime) * 100
alt percent_played >= threshold
PB->>PB: add path to paths_to_remove (percent-based)
else
PB->>PB: keep item
end
else No dbid and insufficient timing info
PB->>PB: keep item
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learningsThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
|
@coderabbitai for the thousandth time, never present diffs, only before and afters!!!!!!! |
|
Tip For best results, initiate chat on the files or code changes. @bossanova808, I sincerely apologize for this ongoing frustration. I can see from the long-term memory that your preference for Before/After code blocks instead of diffs has been recorded multiple times as a CRITICAL preference, yet you're still experiencing issues. I want to be absolutely clear: I understand and will honor your requirement. Moving forward, I will ONLY present code changes using: After: Learnt from: bossanova808 Learnt from: bossanova808 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
resources/lib/playback.py (1)
406-407: Fix threshold fallback logic before shipping.This issue was previously flagged but remains unresolved. The expression
float(get_advancedsetting(...)) or Noneforces any legitimate0threshold back toNone, which then defaults to90, preventing users from disabling the Kodi minimum percent. Additionally, this will raiseTypeErrorif the advancedsetting is missing or blank.Before:
setting = float(get_advancedsetting('video/playcountminimumpercent')) or None playcount_minium_percent = float(setting) if setting else 90.0After:
playcount_minium_percent_value = get_advancedsetting('video/playcountminimumpercent') if playcount_minium_percent_value in (None, ''): playcount_minium_percent = 90.0 else: try: playcount_minium_percent = float(playcount_minium_percent_value) except (TypeError, ValueError): Logger.warning(f"Invalid playcountminimumpercent advancedsetting [{playcount_minium_percent_value!r}] - defaulting to 90.0") playcount_minium_percent = 90.0
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
resources/lib/playback.py(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: bossanova808
PR: bossanova808/plugin.switchback#0
File: :0-0
Timestamp: 2025-09-26T08:11:08.784Z
Learning: User bossanova808 has repeatedly and emphatically requested that code changes should NEVER be presented in diff format. Always use before/after code blocks format for this user. This is a critical preference that must be respected.
Learnt from: bossanova808
PR: bossanova808/plugin.switchback#0
File: :0-0
Timestamp: 2025-09-26T08:11:08.784Z
Learning: CRITICAL PREFERENCE for user bossanova808: NEVER EVER use diff format. Always use "Before:" and "After:" code blocks. This user has been extremely clear and frustrated about this preference. The user has correctly configured .coderabbit.yaml but the system isn't respecting it. This is the user's most important preference and must be honored in every single response.
🔇 Additional comments (2)
resources/lib/playback.py (2)
11-11: LGTM!The import of
get_advancedsettingcorrectly supports the new non-DB item filtering logic.
395-400: LGTM!The DB item filtering logic correctly checks playcount and provides clear logging about why items are being removed.
Summary by CodeRabbit