Skip to content

Commit a627ebc

Browse files
authored
Handle when player doesn't have active queue or active queue index is None
Handle when player doesn't have active queue or active queue index is None
2 parents e5775c7 + 3b4f27b commit a627ebc

File tree

6 files changed

+22
-2
lines changed

6 files changed

+22
-2
lines changed

.github/labels.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,9 @@
8383
- name: "minor"
8484
color: 0e8a16
8585
description: "This PR causes a minor version bump in the version number."
86+
- name: "patch"
87+
color: e2bc85
88+
description: "This PR causes a patch version bump in the version number."
89+
- name: no-changelog
90+
description: Don't add to release changelog
91+
color: fbca04

.github/release-drafter-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ version-resolver:
4747
- "dependencies"
4848
- "documentation"
4949
- "enhancement"
50+
- "patch"
5051
- "performance"
5152
- "refactor"
5253
default: patch

.github/release-drafter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ version-resolver:
4747
- "dependencies"
4848
- "documentation"
4949
- "enhancement"
50+
- "patch"
5051
- "performance"
5152
- "refactor"
5253
default: patch

.github/workflows/release-drafter.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ jobs:
1818
contents: write
1919
pull-requests: write
2020
steps:
21+
- name: Checkout Repo
22+
uses: actions/checkout@v3
23+
- name: Get Version
24+
id: version
25+
run: |
26+
echo "pkg_version=$(jq -r '.version' custom_components/mass_queue/manifest.json)" >> "${GITHUB_OUTPUT}"
2127
- name: Run Release Drafter
2228
uses: release-drafter/[email protected]
29+
with:
30+
tag: ${{ steps.version.outputs.pkg_version }}
31+
version: ${{ steps.version.outputs.pkg_version }}
2332
env:
2433
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

custom_components/mass_queue/actions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ def get_queue_id(self, entity_id: str):
136136
async def get_queue_index(self, entity_id: str):
137137
"""Get the current index of the queue."""
138138
active_queue = await self.get_active_queue(entity_id)
139-
return active_queue.current_index or 0
139+
try:
140+
return active_queue.current_index or 0
141+
except AttributeError:
142+
return 0
140143

141144
async def get_active_queue(self, entity_id: str):
142145
"""Get active queue details."""

custom_components/mass_queue/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"issue_tracker": "https://github.com/droans/mass_queue/issues",
1212
"requirements": ["music-assistant-client"],
1313
"ssdp": [],
14-
"version": "0.4.0",
14+
"version": "0.4.2",
1515
"zeroconf": ["_mass._tcp.local."]
1616
}

0 commit comments

Comments
 (0)