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

Sync very slow with errors caused by dates older than the epoch year (1970) #725

Open
PatientLightning opened this issue Apr 19, 2023 · 13 comments
Labels
bug Something isn't working xbox

Comments

@PatientLightning
Copy link

Describe the bug
When syncing a tv show season or episode older than 1970, the sync process throws errors and slows to a crawl

To Reproduce

  1. Within Jellyfin, edit the metadata of an episode or season to have a release date prior to 1970. ex: 09/21/1957
  2. Open Kodi and Sync Library
  3. Watch the sync progress stop on the episode or season with the pre-epoch release date
  4. See log for an error

Expected behavior
The sync shouldn't have errors for shows older than 1970

Logs
Here's a relevant snippet from the log

 
 
info <general>: JELLYFIN.jellyfin_kodi.helper.utils -> ERROR::jellyfin_kodi\helper\utils.py:491 Item date: 1957-09-21 00:00:00+00:00 --- [Errno 22] Invalid argument
	Traceback (most recent call last):
File "jellyfin_kodi\helper\utils.py", line 484, in convert_to_local
	date = date.astimezone(tz.tzlocal())
File "U:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\_common.py", line 144, in fromutc
	return f(self, dt)
File "U:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\_common.py", line 258, in fromutc
	dt_wall = self._fromutc(dt)
File "U:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\_common.py", line 222, in _fromutc
	dtoff = dt.utcoffset()
	if self._isdst(dt):
File "U:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\tz.py", line 222, in utcoffset
File "U:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\tz.py", line 291, in _isdst
	dstval = self._naive_is_dst(dt)
File "U:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\tz.py", line 260, in _naive_is_dst
  return time.localtime(timestamp + time.timezone).tm_isdst
OSError: [Errno 22] Invalid argument

System (please complete the following information):

  • OS: Xbox One
  • Jellyfin Version: 10.8.6
  • Kodi Version: 20.1
  • Addon Version: 0.7.10+py3
  • Playback Mode: Add-On

Additional context
I think this is caused by the issue referenced here:
https://bugs.python.org/issue31327#msg304159
Where the localtime function returns an error on a windows platform if the date is prior to the epoch

Possibly similar to this other issue: #153

It looks like the sync doesn't hang forever, but it takes about 45 seconds to recover from the error before moving on to sync the next episode which would take hours to process.

@PatientLightning
Copy link
Author

PatientLightning commented Apr 20, 2023

Ok, I have found a fix that works well for now. Here's a minimum example to show the difference from before and after;

Old and Busted
throws "OSError: [Errno 22] Invalid argument" on windows platforms

from dateutil import tz, parser
from six import string_types

date = "1957-09-21 00:00:00+00:00"

date = parser.parse(date) if isinstance(date, string_types) else date
date = date.replace(tzinfo=tz.tzutc())
date = date.astimezone(tz.tzlocal()) #<-- this line throws an error
print(date.strftime('%Y-%m-%dT%H:%M:%S'))

New Hotness
Runs without complaint

import datetime
import time
from dateutil import tz, parser
from six import string_types

date = "1957-09-21 00:00:00+00:00"

date = parser.parse(date) if isinstance(date, string_types) else date
date = date.replace(tzinfo=tz.tzutc())
local_utc_offset = -time.timezone
# ^^^ thanks to: jfs via https://stackoverflow.com/a/3168394
date = date + datetime.timedelta(seconds=local_utc_offset)
# ^^^ thanks to: Ignacio Vazquez-Abrams via https://stackoverflow.com/a/22082178
print(date.strftime('%Y-%m-%dT%H:%M:%S'))

I updated utils.py with the relevant bits and copied it over to my Xbox and I was able to resume the sync successfully without errors. Now the only thing I have to remember is that the dates and times for media should always be stored in UTC, so they will be displayed correctly in the local time zone.

I don't know how to turn this into a pull request yet, but I guess that's the next thing I'll figure out

@Zandengoff
Copy link

Logged in to let you know that I too believe I have this issue. Have an Xbox Kodi install that is stalling on sync when it hit Bewitched (obviously made before 1970).

Would you be able to share the modified plugin so that I can test as well?

@PatientLightning
Copy link
Author

For sure,

I think I figured out how to add a pull request, so you can get the file from here:
#756
Hopefully this will be approved for the next release so I don't have to copy over files again.

To install it for testing, I put the modified utils.py onto a USB stick and plugged it into the Xbox to copy it over the existing one in Kodi.

@Zandengoff
Copy link

Zandengoff commented Jul 17, 2023

For sure,

I think I figured out how to add a pull request, so you can get the file from here: #756 Hopefully this will be approved for the next release so I don't have to copy over files again.

To install it for testing, I put the modified utils.py onto a USB stick and plugged it into the Xbox to copy it over the existing one in Kodi.

That did it. I was sitting at overnight with a sync (and not finishing). Replaced the util.py file in the helpers folder, cleared my DB and tried again. Finished with a 15 minute sync. Wife is again happy.

Thank you so much!

@oddstr13
Copy link
Member

oddstr13 commented Oct 21, 2023

With #775 #776 #780 and now finally #785, I'm not able to reproduce this issue in tests (py3 only), even tho the underlying timezone function is unchanged.

The current test cases are as follows, and should cover most edge cases, including dates pre epoch:

# Special case for malformed data from the server, see #212
("0001-01-01T00:00:00.0000000Z", "UTC", "0001-01-01T00:00:00"),
("Hello, error.", "Etc/UTC", "Hello, error."),
("2023-09-21T23:54:24", "Etc/UTC", "2023-09-21T23:54:24"),
# See #725
("1957-09-21T00:00:00Z", "Europe/Paris", "1957-09-21T01:00:00"),
("1970-01-01T00:00:00", "Etc/UTC", "1970-01-01T00:00:00"),
("1969-01-01T00:00:00", "Etc/UTC", "1969-01-01T00:00:00"),
("1970-01-01T00:00:00", "Europe/Oslo", "1970-01-01T01:00:00"),
("1969-01-01T00:00:00", "Europe/Oslo", "1969-01-01T01:00:00"),
("2023-09-21T23:54:24", "Europe/Oslo", "2023-09-22T01:54:24"),
# End of DST in Europe
("2023-10-29T00:00:00", "Europe/Oslo", "2023-10-29T02:00:00"),
("2023-10-29T00:59:59", "Europe/Oslo", "2023-10-29T02:59:59"),
("2023-10-29T01:00:00", "Europe/Oslo", "2023-10-29T02:00:00"),
# Start of DST in Europe
("2023-03-26T00:59:59", "Europe/Oslo", "2023-03-26T01:59:59"),
("2023-03-26T01:00:00", "Europe/Oslo", "2023-03-26T03:00:00"),
# Norway was in permanent summertime 1940-08-11 -> 1942-11-02
("1941-06-24T00:00:00", "Europe/Oslo", "1941-06-24T02:00:00"),
("1941-12-24T00:00:00", "Europe/Oslo", "1941-12-24T02:00:00"),
# Not going to test them all, but you get the point...
# First one fails on Windows with tzdata==2023.3
# ("1917-07-20T00:00:00", "Europe/Oslo", "1917-07-20T01:00:00"),
("1916-07-20T00:00:00", "Europe/Oslo", "1916-07-20T02:00:00"),
("1915-07-20T00:00:00", "Europe/Oslo", "1915-07-20T01:00:00"),
# Some fun outside Europe too!
("2023-03-11T03:30:00", "America/St_Johns", "2023-03-11T00:00:00"),
("2023-03-13T02:30:00", "America/St_Johns", "2023-03-13T00:00:00"),
("2023-11-04T02:30:00", "America/St_Johns", "2023-11-04T00:00:00"),
("2023-11-06T03:30:00", "America/St_Johns", "2023-11-06T00:00:00"),
("2023-12-24T00:00:00", "Australia/Eucla", "2023-12-24T08:45:00"),
("2023-06-24T00:00:00", "Australia/Eucla", "2023-06-24T08:45:00"),
("2023-12-24T00:00:00", "Australia/Broken_Hill", "2023-12-24T10:30:00"),
("2023-06-24T00:00:00", "Australia/Broken_Hill", "2023-06-24T09:30:00"),
("2023-10-31T00:00:00", "Pacific/Kiritimati", "2023-10-31T14:00:00"),
("2023-10-31T00:00:00", "Pacific/Midway", "2023-10-30T13:00:00"),

If you are still seeing this issue with the master branch, I would like more logs from both of you, at a minimum the following sections:

$ cat ~/.kodi/temp/kodi.log | python -c 'import re,sys;print(re.match("\n?.*?-{71}.*?-{71}", sys.stdin.read(), flags=re.DOTALL)[0])'

2023-10-20 13:59:42.850 T:2074881    info <general>: -----------------------------------------------------------------------
2023-10-20 13:59:42.850 T:2074881    info <general>: Starting Kodi (20.2 (20.2.0) Git:20230630-5f418d0b13). Platform: Linux x86 64-bit
2023-10-20 13:59:42.850 T:2074881    info <general>: Using Release Kodi x64
2023-10-20 13:59:42.850 T:2074881    info <general>: Kodi compiled 2023-06-30 by GCC 11.3.0 for Linux x86 64-bit version 5.15.99 (331619)
2023-10-20 13:59:42.850 T:2074881    info <general>: Running on Linux Mint 21.2, kernel: Linux x86 64-bit version 5.15.0-84-generic
2023-10-20 13:59:42.851 T:2074881    info <general>: FFmpeg version/source: 4.4.1-Kodi
2023-10-20 13:59:42.851 T:2074881    info <general>: Host CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz, 8 cores available
2023-10-20 13:59:42.851 T:2074881    info <general>: special://xbmc/ is mapped to: /usr/share/kodi
2023-10-20 13:59:42.851 T:2074881    info <general>: special://xbmcbin/ is mapped to: /usr/lib/x86_64-linux-gnu/kodi
2023-10-20 13:59:42.851 T:2074881    info <general>: special://xbmcbinaddons/ is mapped to: /usr/lib/x86_64-linux-gnu/kodi/addons
2023-10-20 13:59:42.851 T:2074881    info <general>: special://masterprofile/ is mapped to: /home/oddstr13/.kodi/userdata
2023-10-20 13:59:42.851 T:2074881    info <general>: special://envhome/ is mapped to: /home/oddstr13
2023-10-20 13:59:42.851 T:2074881    info <general>: special://home/ is mapped to: /home/oddstr13/.kodi
2023-10-20 13:59:42.851 T:2074881    info <general>: special://temp/ is mapped to: /home/oddstr13/.kodi/temp
2023-10-20 13:59:42.851 T:2074881    info <general>: special://logpath/ is mapped to: /home/oddstr13/.kodi/temp
2023-10-20 13:59:42.851 T:2074881    info <general>: Webserver extra whitelist paths: 
2023-10-20 13:59:42.851 T:2074881    info <general>: The executable running is: /usr/lib/x86_64-linux-gnu/kodi/kodi.bin
2023-10-20 13:59:42.851 T:2074881    info <general>: Local hostname: 1070L
2023-10-20 13:59:42.851 T:2074881    info <general>: Log File is located: /home/oddstr13/.kodi/temp/kodi.log
2023-10-20 13:59:42.851 T:2074881    info <general>: -----------------------------------------------------------------------

$ grep -Pi 'entrypoint/service.py:[0-9]{2} ' ~/.kodi/temp/kodi.log

2023-10-20 13:59:44.914 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:62 --->>>[ JELLYFIN ]
2023-10-20 13:59:44.915 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:63 Version: 0.7.5+py3
2023-10-20 13:59:44.916 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:64 KODI Version: 20.2 (20.2.0) Git:20230630-5f418d0b13
2023-10-20 13:59:44.917 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:65 Platform: Linux/RPi
2023-10-20 13:59:44.918 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:66 Python Version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
2023-10-20 13:59:44.921 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:67 Using dynamic paths: True
2023-10-20 13:59:44.921 T:2074916    info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi/entrypoint/service.py:68 Log Level: 2

@oddstr13 oddstr13 added the question Further information is requested label Oct 21, 2023
@staplebatteryhorse
Copy link

staplebatteryhorse commented Feb 3, 2024

I have (I think) the same issue on xbox series x. Using new clean kodi install with no addons except jellyfin for kodi.

Not sure if this link is relevant (its cpython) it seemed similar and affected windows only not linux python/cpython#94414

My kodi log right after a (long) sync with jellyfin:

$ cat kodi.log | python -c 'import re,sys;print(re.match("\n?.*?-{71}.*?-{71}", sys.stdin.read(), flags=re.DOTALL)[0])'

2024-02-03 18:52:29.334 T:3220     info <general>: -----------------------------------------------------------------------
2024-02-03 18:52:29.334 T:3220     info <general>: Starting Kodi (20.3 (20.3.0) Git:20240110-6fb2bfc7ff). Platform: Windows NT x86 64-bit
2024-02-03 18:52:29.335 T:3220     info <general>: Using Release Kodi x64
2024-02-03 18:52:29.335 T:3220     info <general>: Kodi compiled 2024-01-10 by MSVC 193431937 for Windows NT x86 64-bit version 10.0 (0x0A000007)
2024-02-03 18:52:29.335 T:3220     info <general>: Running on Microsoft Xbox Series X with WINDOWS 10.0.25398.2923, kernel: WINDOWS x86 64-bit version 10.0.25398.2923
2024-02-03 18:52:29.336 T:3220     info <general>: FFmpeg version/source: 4.4.1-Kodi
2024-02-03 18:52:29.336 T:3220     info <general>: Host CPU: Unknown, 8 cores available
2024-02-03 18:52:29.336 T:3220     info <general>: System has 4.3 GB of RAM installed
2024-02-03 18:52:29.340 T:3220     info <general>: Desktop Resolution: 1920x1080 24Bit at 59.94Hz
2024-02-03 18:52:29.340 T:3220     info <general>: Running with restricted rights
2024-02-03 18:52:29.340 T:3220     info <general>: Aero is disabled
2024-02-03 18:52:29.342 T:3220     info <general>: Display is not HDR capable or cannot be detected
2024-02-03 18:52:29.343 T:3220     info <general>: special://xbmc/ is mapped to: S:\Program Files\WindowsApps\XBMCFoundation.Kodi_20.3.0.70_x64__4n2hpmxwrvr6p
2024-02-03 18:52:29.343 T:3220     info <general>: special://xbmcbin/ is mapped to: S:\Program Files\WindowsApps\XBMCFoundation.Kodi_20.3.0.70_x64__4n2hpmxwrvr6p
2024-02-03 18:52:29.343 T:3220     info <general>: special://xbmcbinaddons/ is mapped to: S:\Program Files\WindowsApps\XBMCFoundation.Kodi_20.3.0.70_x64__4n2hpmxwrvr6p/addons
2024-02-03 18:52:29.343 T:3220     info <general>: special://masterprofile/ is mapped to: Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\userdata
2024-02-03 18:52:29.343 T:3220     info <general>: special://home/ is mapped to: Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState
2024-02-03 18:52:29.343 T:3220     info <general>: special://temp/ is mapped to: Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\cache
2024-02-03 18:52:29.343 T:3220     info <general>: special://logpath/ is mapped to: Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState
2024-02-03 18:52:29.343 T:3220     info <general>: Webserver extra whitelist paths: 
2024-02-03 18:52:29.343 T:3220     info <general>: The executable running is: S:\Program Files\WindowsApps\XBMCFoundation.Kodi_20.3.0.70_x64__4n2hpmxwrvr6p\kodi.exe
2024-02-03 18:52:29.344 T:3220     info <general>: Local hostname: XBOX
2024-02-03 18:52:29.344 T:3220     info <general>: Log File is located: Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\kodi.log
2024-02-03 18:52:29.345 T:3220     info <general>: -----------------------------------------------------------------------

~ [0|1]> cat kodi.log | grep -i 'entrypoint'
2024-02-03 18:52:32.727 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:62 --->>>[ JELLYFIN ]
2024-02-03 18:52:32.728 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:63 Version: 0.7.11+py3
2024-02-03 18:52:32.730 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:64 KODI Version: 20.3 (20.3.0) Git:20240110-6fb2bfc7ff
2024-02-03 18:52:32.733 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:65 Platform: Windows
2024-02-03 18:52:32.735 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:66 Python Version: 3.8.15 (default, Oct 17 2022, 02:35:03) [MSC v.1929 64 bit (AMD64)]
2024-02-03 18:52:32.737 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:67 Using dynamic paths: True
2024-02-03 18:52:32.739 T:324      info <general>: JELLYFIN.jellyfin_kodi.entrypoint.service -> INFO::jellyfin_kodi\entrypoint\service.py:68 Log Level: 1

The relevant error as far as I can see is the same as in previous posts

2024-02-03 19:59:55.762 T:3264     info <general>: JELLYFIN.jellyfin_kodi.helper.utils -> ERROR::jellyfin_kodi\helper\utils.py:491 Item date: 1964-11-08 00:00:00+00:00 --- [Errno 22] Invalid argument
                                                   Traceback (most recent call last):
                                                     File "jellyfin_kodi\helper\utils.py", line 484, in convert_to_local
                                                       date = date.astimezone(tz.tzlocal())
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\_common.py", line 144, in fromutc
                                                       return f(self, dt)
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\_common.py", line 258, in fromutc
                                                       dt_wall = self._fromutc(dt)
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\_common.py", line 222, in _fromutc
                                                       dtoff = dt.utcoffset()
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\tz.py", line 222, in utcoffset
                                                       if self._isdst(dt):
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\tz.py", line 291, in _isdst
                                                       dstval = self._naive_is_dst(dt)
                                                     File "Q:\Users\UserMgr0\AppData\Local\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalState\addons\script.module.dateutil\lib\dateutil\tz\tz.py", line 260, in _naive_is_dst
                                                       return time.localtime(timestamp + time.timezone).tm_isdst
                                                   OSError: [Errno 22] Invalid argument
                                                   

Full log is here up until the point kodi crashed at 80% sync https://paste.kodi.tv/eqoyevivuz

I've applied the work around PatientLightening suggested above and it seems fix the scanning error.

@oddstr13
Copy link
Member

oddstr13 commented Feb 3, 2024

@staplebatteryhorse I pushed the release containing the mentioned fixes just as you where typing out this comment it seems, could you try again with the latest release (sorry, the release pipeline is just inconvenient enough that I end up putting it off 😅 )

PS: You seem to have swapped the username and password fields 😉

@staplebatteryhorse
Copy link

@oddstr13 thanks, I have just tried with master and 0.7.12 release, the same issue is still happening.

log file here https://paste.kodi.tv/xogoreguco

@oddstr13 oddstr13 added bug Something isn't working xbox and removed question Further information is requested labels Feb 4, 2024
@oddstr13
Copy link
Member

oddstr13 commented Feb 4, 2024

Thanks for the updated logs!

Starting Kodi (20.3 (20.3.0) Git:20240110-6fb2bfc7ff). Platform: Windows NT x86 64-bit
Using Release Kodi x64
Kodi compiled 2024-01-10 by MSVC 193431937 for Windows NT x86 64-bit version 10.0 (0x0A000007)
Running on Microsoft Xbox Series X with WINDOWS 10.0.25398.2923, kernel: WINDOWS x86 64-bit version 10.0.25398.2923

ERROR::jellyfin_kodi\helper\utils.py:499

The dates in question; indicates trouble with negative (signed) unixtime values

Item date: 1967-09-29 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-09-13 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-09-13 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-09-20 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-09-27 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-10-04 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-10-11 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-10-18 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-10-25 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-11-01 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-11-08 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-11-15 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-11-22 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-11-29 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-12-06 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-12-13 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1969-12-20 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1966-09-08 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-01-05 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-01-12 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-01-19 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-01-26 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-02-02 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-02-09 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-02-16 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-02-23 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-03-02 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-03-09 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-03-23 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-03-30 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-04-06 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1967-04-13 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1966-09-08 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1966-09-15 00:00:00+00:00 --- [Errno 22] Invalid argument
Item date: 1966-09-22 00:00:00+00:00 --- [Errno 22] Invalid argument

@it5c0z1mG
Copy link

This issue has now come back since the new update and the patched utils file only works on the previous build, had to revert again until fixed, please help. @PatientLightning if you have any idea how to make a new patch for the latest build please let me in on the secret as i am clueless

@PatientLightning
Copy link
Author

This issue has now come back since the new update and the patched utils file only works on the previous build, had to revert again until fixed, please help. @PatientLightning if you have any idea how to make a new patch for the latest build please let me in on the secret as i am clueless

Oh no, what is the new version you're using and what system? Still Xbox? I haven't turned mine on in a while, but I'll take a look when I can

@PatientLightning
Copy link
Author

Ok, I updated the helpter/utils.py file with the same approach as last time. My secret is to avoid using the function date.astimezone because it still returns an error on windows platforms for dates before 1970. (https://bugs.python.org/issue31327#msg304159)

You can grab a copy from my fork to test out.
https://github.com/PatientLightning/jellyfin-kodi/blob/helper-utils-2024-07/jellyfin_kodi/helper/utils.py
If you look at the commit diff you can see the few lines that I have substituted as a naïve workaround.

The real fix is to solve the problem upstream with date.astimezone in the python repo someday, but I hope this helps in the meantime.

@it5c0z1mG
Copy link

@PatientLightning youre a hero! I will give it a test later tonight, yes still xbox, i have about 6 of them laying around just for kodi in different rooms, i did try to incorporate your additions and make a file myself before messeging you but ended up messing it up 5x so gave up, im obviously not built for writing code🤣 i hope they add your fix into the main releases soon as i get a whole house yelling at me to fix it everytime it updates🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working xbox
Projects
None yet
Development

No branches or pull requests

5 participants