[mythtv-commits] [MythTV/mythtv] a7826b: TV Grabber: Support for TheTVDB v4 API

rcrdnalor noreply at github.com
Tue Jan 18 21:31:39 UTC 2022


  Branch: refs/heads/fixes/31
  Home:   https://github.com/MythTV/mythtv
  Commit: a7826bec682828d0d55fcaf05958ea1aedcd03fb
      https://github.com/MythTV/mythtv/commit/a7826bec682828d0d55fcaf05958ea1aedcd03fb
  Author: Roland Ernst <rcrernst at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mythtv/bindings/python/setup.py
    A mythtv/bindings/python/ttvdbv4/__init__.py
    A mythtv/bindings/python/ttvdbv4/definitions.py
    A mythtv/bindings/python/ttvdbv4/get_api_v4.py
    A mythtv/bindings/python/ttvdbv4/locales.py
    A mythtv/bindings/python/ttvdbv4/myth4ttvdbv4.py
    A mythtv/bindings/python/ttvdbv4/ttvdbv4_api.py
    A mythtv/bindings/python/ttvdbv4/utils.py
    A mythtv/programs/scripts/metadata/Television/ttvdb4.ini
    A mythtv/programs/scripts/metadata/Television/ttvdb4.py
    A mythtv/programs/scripts/metadata/Television/ttvdb4_doctests

  Log Message:
  -----------
  TV Grabber: Support for TheTVDB v4 API

This is a backport of the 'ttvdb4.py' television grabber from
MythTV/master to fixes/31.
The current API from thetvdb.com (v3) is marked as deprecated
and will be removed soon.

The TheTVDB v4 API specification is located at
https://github.com/thetvdb/v4-api/blob/main/docs/swagger.yml

Please look at https://github.com/thetvdb/v4-api/issues
before raising any issues against MythTV.

In order to enable this grabber, run in mythtv frontend
"Setup" -> "Artwork and Data Sources"
and select 'TheTVDatabaseV4' for the default TelevisionGrabber.

Upon first start, a file named 'ttvdb4.ini' is created under
the '$HOME/.mythtv' folder, which lets you add some options, like
additional languages to seach. Edit this file according your needs.

Refs #463


  Commit: 9c53e17d754b50ac8ef4e02552620a1332fba718
      https://github.com/MythTV/mythtv/commit/9c53e17d754b50ac8ef4e02552620a1332fba718
  Author: Roland Ernst <rcrernst at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mythtv/bindings/python/MythTV/database.py

  Log Message:
  -----------
  Fix time and date handling on upgraded MariaDB

In MariaDB 10.1.2 a new temporal format was introduced from
MySQL 5.6 that alters how the `TIME`, `DATETIME` and `TIMESTAMP`
columns operate at lower levels. These changes allow these temporal
data types to have fractional parts and negative values.
You can disable this feature using the `mysql56_temporal_format`
system variable.

Starting from MariaDB 10.5.1 columns with old temporal formats are
marked with a `/* mariadb-5.3 */` comment in the output of
`SHOW CREATE TABLE`, `SHOW COLUMNS`, `DESCRIBE` statements, as well
as in the `COLUMN_TYPE` column of the `INFORMATION_SCHEMA.COLUMNS`
Table.

Since the python bindings use the `DESCRIBE` statement to identify
the type of an MySQL entry, the comment must be stripped off.

This happens on old MariaDB databases upgraded automatically
during system upgrade, e.g.: Debian 10 -> 11.

Ref: https://mariadb.com/kb/en/datetime/

Fixes #384

(cherry picked from commit 645ad05a3ecccb7ceee3cce4897bd6b6aae6d94c)


  Commit: 96d1a1952536c6ca019a0240332f0a899672f78e
      https://github.com/MythTV/mythtv/commit/96d1a1952536c6ca019a0240332f0a899672f78e
  Author: Roland Ernst <rcrernst at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mythtv/bindings/python/MythTV/ttvdb/requests_cache_compatability.py

  Log Message:
  -----------
  TV grabber ttvdb.py fails with newer versions of

python package request-cache.

This was reported on the forum, it throws this
Error: (module 'requests_cache' has no attribute 'core')

It turned out, that the monkey patch provided by
`mythtv/bindings/python/MythTV/ttvdb/requests_cache_compatability.py`
is only valid for versions of request-cache < '0.5.0'. Newer versions
do not need this patch and versions beyond '0.8.0' crashes with above
error message.
Note: The module requests_cache.core was removed in version '0.8.0'
on Sept. 2021 and deprecated in version '0.6.0' in April, 2021.

Refs #408

(cherry picked from commit da3f00653588813fc225eafa146d975b26986819)


  Commit: 5b46d518a5987a94d27718c122f2a1f07d6e3543
      https://github.com/MythTV/mythtv/commit/5b46d518a5987a94d27718c122f2a1f07d6e3543
  Author: Roland Ernst <rcrernst at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mythtv/bindings/python/MythTV/msearch.py

  Log Message:
  -----------
  Fix error with python3.10 on MythTV/msearch.py

Traceback (most recent call last):
  File "/.../MythTV/msearch.py", line 35, in __init__
    self.sock.setblocking(0.1)
TypeError: 'float' object cannot be interpreted as an integer

Python's socket implementation allows to set the blocking mode with
 - setblocking([0/1] or
 - settimeout(float)  # i.e '0.0'

Prior to python3.10, 'setblocking' evaluated the float value to an integer,
which results in this case to zero (tested with 'socket.gettimeout'()).

Make it clear, that we want the non-blocking mode.

Tested with python3.6 and 3.10.

(cherry picked from commit e57584bab7d25dc3438b7661c3cc33f5d92b4a13)


  Commit: 23738a70743aef39e6e47c1b78c1fa8e9ec03a7a
      https://github.com/MythTV/mythtv/commit/23738a70743aef39e6e47c1b78c1fa8e9ec03a7a
  Author: Roland Ernst <rcrernst at gmail.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M mythtv/bindings/python/MythTV/utility/other.py

  Log Message:
  -----------
  Python Bindings: Fix uncaught exception in 'deadlinesocket'

Python Bindings throws an error if the socket does not provide data:
Traceback (most recent call last):
....
File "/usr/lib/python3/dist-packages/MythTV/utility/other.py", line 374, in dlexpect
raise MythError(MythError.CLOSEDSOCKET)
AttributeError: type object 'MythError' has no attribute 'CLOSEDSOCKET'

Solution:
Align the error code to the methods provided by MythError.SOCKET.

Fixes #423

(cherry picked from commit 1e6246da6845370938eee6f75ecbf915559f7448)


Compare: https://github.com/MythTV/mythtv/compare/25f1bb1d12fd...23738a70743a


More information about the mythtv-commits mailing list