| Conditions | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 1.2963 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | from plugin.models.core import db |
|
| 24 | 1 | @classmethod |
|
| 25 | def has_scrobbled(cls, account, rating_key, after): |
||
| 26 | # Find matching "scrobble" events |
||
| 27 | results = ActionHistory.select().where( |
||
| 28 | ActionHistory.account == account, |
||
| 29 | ActionHistory.rating_key == rating_key, |
||
| 30 | |||
| 31 | ActionHistory.performed == 'scrobble', |
||
| 32 | |||
| 33 | ActionHistory.sent_at > after |
||
| 34 | ) |
||
| 35 | |||
| 36 | # Check for at least one result |
||
| 37 | return results.count() > 0 |
||
| 38 |