Conversation
| #~ msgid "Authorize the trakt addon to access your account." | ||
| #~ msgstr "Authorize the trakt addon to access your account." | ||
|
|
||
| #~ msgctxt "#32161" |
There was a problem hiding this comment.
How do I generate the correct po files and add the missing translations?
There was a problem hiding this comment.
The base translation file is en_gb so you should only be editing that
There was a problem hiding this comment.
I'm noticing errors in git due to there being a en_US and en_us language folder for example.
warning: the following paths have collided (e.g. case-sensitive paths
on a case-insensitive filesystem) and only one from the same
colliding group is in the working tree:
'resources/language/resource.language.es_AR/strings.po'
'resources/language/resource.language.es_ar/strings.po'
'resources/language/resource.language.es_MX/strings.po'
'resources/language/resource.language.es_mx/strings.po'
'resources/language/resource.language.nb_NO/strings.po'
'resources/language/resource.language.nb_no/strings.po'
'resources/language/resource.language.pt_BR/strings.po'
'resources/language/resource.language.pt_br/strings.po'
resources/lib/kodiUtilities.py
Outdated
| if 'lastplayed' in data: | ||
| episode['watched_at'] = utilities.convertDateTimeToUTC( | ||
| data['lastplayed']) | ||
| episode['last_watched_at'] = utilities.to_iso8601_datetime( |
There was a problem hiding this comment.
The key watched_at was inconsistent with Trakt's last_watched_at so I updated it.
There was a problem hiding this comment.
Kodi's timestamps were in a different format from those the Trakt.py library provides so this was updated.
resources/lib/syncEpisodes.py
Outdated
| show_dict = show.to_dict() | ||
| # reset_at is not included when calling `.to_dict()` | ||
| # but needed for watched shows to know whether to reset the watched state | ||
| show_dict['reset_at'] = utilities.to_iso8601_datetime(show.reset_at) if hasattr(show, 'reset_at') else None |
There was a problem hiding this comment.
The reset_at is now needed on a show, and while Show extends Media in the trakt.py library, it is not included when calling to_dict() on a show.
resources/lib/utilities.py
Outdated
| diff = list(set(a).difference(set(b))) | ||
| for key in a: | ||
| # update lastplayed in KODI if they don't match trakt | ||
| if not key in b or a[key]['last_watched_at'] != b[key]['last_watched_at']: |
There was a problem hiding this comment.
Not a 100% sure is this is the correct solution. This will update any out of date timestamps not just ones to be removed.
resources/lib/utilities.py
Outdated
| return local.strftime(dateFormat) | ||
| else: | ||
| return toConvert | ||
| def to_datetime(value): |
There was a problem hiding this comment.
I replaced the existing datetime transformation methods with these 4 new ones, the iso8601 methods come from the trakt.py library.
|
A current limitation is that if Kodi doesn't properly scrobble a play on a rewatch, the play is removed from Kodi on next sync. |
|
@razzeee Do you have any ideas on how to overcome my mentioned limitation? So we can get this PR merged. |
99113f1 to
dd8d70b
Compare
I think the only way to properly fix this is changing the database scheme in kodi itself. |
dd8d70b to
2a5a676
Compare
2a5a676 to
3a7740d
Compare
This PR adds support for Trakt's rewatch feature. When enabled, the plugin will reset the
lastplayedandplaysin Kodi's database when the value is lower than thereset_aton the show provided by the Trakt API.This is achieved by iterating through the episode and settings the
last_watched_attoNonewhen thereset_atis greater than thelast_watched_at. This allows most logic of the plugin to remain unchanged.Fixes #292