Skip to content

Commit 4427006

Browse files
author
Jon Kristian Nilsen
committed
Added audiobook support. Added external media content to the data object.
1 parent 85c2141 commit 4427006

File tree

3 files changed

+51
-42
lines changed

3 files changed

+51
-42
lines changed

.devcontainer.json

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
2-
"name": "ludeeus/integration_blueprint",
3-
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye",
4-
"postCreateCommand": "scripts/setup",
5-
"forwardPorts": [
6-
8123
7-
],
8-
"customizations": {
9-
"vscode": {
10-
"extensions": [
11-
"ms-python.python",
12-
"github.vscode-pull-request-github",
13-
"ryanluker.vscode-coverage-gutters",
14-
"ms-python.vscode-pylance"
15-
],
16-
"settings": {
17-
"files.eol": "\n",
18-
"editor.tabSize": 4,
19-
"python.pythonPath": "/usr/bin/python3",
20-
"python.analysis.autoSearchPaths": false,
21-
"python.linting.pylintEnabled": true,
22-
"python.linting.enabled": true,
23-
"python.formatting.provider": "black",
24-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
25-
"editor.formatOnPaste": false,
26-
"editor.formatOnSave": true,
27-
"editor.formatOnType": true,
28-
"files.trimTrailingWhitespace": true
29-
}
30-
}
31-
},
32-
"remoteUser": "vscode",
33-
"features": {
34-
"rust": "latest"
35-
}
36-
}
2+
"name": "ludeeus/integration_blueprint",
3+
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye",
4+
"postCreateCommand": "scripts/setup",
5+
"forwardPorts": [
6+
8123
7+
],
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"ms-python.python",
12+
"github.vscode-pull-request-github",
13+
"ryanluker.vscode-coverage-gutters",
14+
"ms-python.vscode-pylance"
15+
],
16+
"settings": {
17+
"files.eol": "\n",
18+
"editor.tabSize": 4,
19+
"python.pythonPath": "/usr/bin/python3",
20+
"python.analysis.autoSearchPaths": false,
21+
"python.linting.pylintEnabled": true,
22+
"python.linting.enabled": true,
23+
"python.formatting.provider": "black",
24+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
25+
"editor.formatOnPaste": false,
26+
"editor.formatOnSave": true,
27+
"editor.formatOnType": true,
28+
"files.trimTrailingWhitespace": true
29+
}
30+
}
31+
},
32+
"remoteUser": "vscode",
33+
"features": {
34+
"rust": "latest"
35+
}
36+
}

custom_components/mediatracker/calendar.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,19 @@ async def get_calendar_item(self, calendar_item) -> object | None:
103103
if EXPAND_DETAILS is True:
104104
media_description = media_details.overview
105105

106-
# if media.mediaType == "audiobook":
107106
# if media.mediaType == "book":
108107
# if media.mediaType == "movie":
109108

109+
if media.mediaType == "audiobook":
110+
audibleDomain = 'com'
111+
media_sources = {
112+
"audible": f"https://audible.{audibleDomain}/pd/{media_details.audibleId}?overrideBaseCountry=true&ipRedirectOverride=true"
113+
}
114+
110115
if media.mediaType == "video_game":
111-
media_sources = {
112-
"igdb": f"https://www.igdb.com/games/{media_details.title.lower().replace(' ', '-')}"
113-
}
116+
media_sources = {
117+
"igdb": f"https://www.igdb.com/games/{media_details.title.lower().replace(' ', '-')}"
118+
}
114119

115120
if media.mediaType == "tv":
116121
media_title = f"{media.title}"
@@ -141,10 +146,14 @@ async def get_calendar_item(self, calendar_item) -> object | None:
141146
'host': self._entry.data.get("host"),
142147
'token': self._entry.data.get("token"),
143148
'poster': media_details.poster,
149+
'poster_external': media_details.externalPosterUrl,
144150
'backdrop': media_details.backdrop,
151+
'backdrop_external': media_details.externalBackdropUrl,
145152
'sources': media_sources,
146153
'tmdb_rating': media_rating,
147154
'developer': media_details.developer,
155+
'authors': media_details.authors,
156+
'narrators': media_details.narrators,
148157
'url': media_details.url,
149158
}
150159

custom_components/mediatracker/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"config_flow": true,
55
"documentation": "https://github.com/jonkristian/mediatracker-ha",
66
"issue_tracker": "https://github.com/jonkristian/mediatracker-ha/issues",
7-
"version": "0.1.0",
7+
"version": "0.1.1",
88
"requirements": [
9-
"pymediatracker==0.1.1"
9+
"pymediatracker==0.1.3"
1010
],
1111
"codeowners": [
1212
"@jonkristian"
1313
],
1414
"iot_class": "local_polling"
15-
}
15+
}

0 commit comments

Comments
 (0)