Skip to content

Commit e73d26e

Browse files
committed
fix(songs): corrected dtypes (#144)
1 parent 400f829 commit e73d26e

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

churchtools_api/songs.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def delete_song(self, song_id: int) -> bool:
304304

305305
return True
306306

307-
def contains_song_tag(self, song_id: int, song_tag_name: int) -> bool:
307+
def contains_song_tag(self, song_id: int, song_tag_name: str) -> bool:
308308
"""Helper which checks if a specific song_tag_id is present on a song.
309309
310310
Arguments:
@@ -317,13 +317,12 @@ def contains_song_tag(self, song_id: int, song_tag_name: int) -> bool:
317317
tags = self.get_tag(domain_type="song", domain_id=song_id, rtype="name_dict")
318318
return song_tag_name in tags
319319

320-
def get_songs_by_tag(self, song_tag_name: int) -> list[dict]:
320+
def get_songs_by_tag(self, song_tag_name: str) -> list[dict]:
321321
"""Helper which returns all songs that contain have a specific tag.
322322
323323
Arguments:
324-
song_tag_name: ChurchTools site specific song_tag_id which should be used
325-
OR
326-
song_tag_id
324+
song_tag_name: name of a song tag that is used
325+
in respective ChurchTools instace
327326
328327
Returns:
329328
list of songs
@@ -367,7 +366,7 @@ def get_song_arrangement(
367366
return next(
368367
arrangement
369368
for arrangement in song["arrangements"]
370-
if song["arrangements"][0]["isDefault"]
369+
if arrangement["isDefault"]
371370
)
372371

373372
def create_song_arrangement(self, song_id: int, arrangement_name: str) -> int:

churchtools_api/tags.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def remove_tag(self, domain_type: str, domain_id: str, tag_name: str) -> bool:
115115
return True
116116

117117
def get_tag(
118-
self, domain_type: str, domain_id: str, rtype: str = "original"
119-
) -> list[dict]:
118+
self, domain_type: str, domain_id: int, rtype: str = "original"
119+
) -> list[dict] | None:
120120
"""Retrieves the readable tags of one single object.
121121
122122
Args:

0 commit comments

Comments
 (0)