From 2682901d7811b182b1148dbf0c0582e829ae7956 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sun, 11 Aug 2024 18:38:36 +0200 Subject: [PATCH] Handle more tolino specific cases. --- src/calibre/devices/kobo/driver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/devices/kobo/driver.py b/src/calibre/devices/kobo/driver.py index 0498f2d07f..abaf3360ac 100644 --- a/src/calibre/devices/kobo/driver.py +++ b/src/calibre/devices/kobo/driver.py @@ -2173,7 +2173,7 @@ class KOBOTOUCH(KOBO): def path_from_contentid(self, ContentID, ContentType, MimeType, oncard, externalId=None): path = ContentID - if not (externalId or MimeType == 'application/octet-stream'): + if not (externalId or MimeType == 'application/octet-stream' or (self.isTolinoDevice() and MimeType == 'audio/mpeg')): return super().path_from_contentid(ContentID, ContentType, MimeType, oncard) if oncard == 'cardb': @@ -2182,6 +2182,8 @@ class KOBOTOUCH(KOBO): if (ContentType == "6" or ContentType == "10"): if (MimeType == 'application/octet-stream'): # Audiobooks purchased from Kobo are in a different location. path = self._main_prefix + KOBO_ROOT_DIR_NAME + '/audiobook/' + path + elif (MimeType == 'audio/mpeg' and self.isTolinoDevice()): + path = self._main_prefix + KOBO_ROOT_DIR_NAME + '/audiobook/' + path elif path.startswith("file:///mnt/onboard/"): path = self._main_prefix + path.replace("file:///mnt/onboard/", '') elif path.startswith("file:///mnt/sd/"):