@@ -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 :
@@ -426,6 +425,14 @@ def edit_song_arrangement(
426425 duration: (int) lenght in full seconds.
427426 note: (str) more detailed explanation text.
428427
428+ Not useable Keywords due to bug
429+ #TODO@bensteUEM: only some parameters can be applied
430+ # CT support case 147728
431+ # https://github.com/bensteUEM/ChurchToolsAPI/issues/144
432+ source_name: (int|str) id of the source as defined in masterdata.
433+ Alternatively also accepts shortname.
434+ source_reference: (str) source reference number.
435+
429436 Returns:
430437 if changes were applied successful
431438 """
@@ -434,16 +441,35 @@ def edit_song_arrangement(
434441 existing_arrangement = self .get_song_arrangement (
435442 song_id = song_id , arrangement_id = arrangement_id
436443 )
437-
438- if isinstance (kwargs .get ("source_id" ), int ):
439- source_id = kwargs .get ("source_id" )
440- elif isinstance (kwargs .get ("source_id" ), str ):
441- source_id = self .lookup_song_source_as_id (shortname = kwargs .get ("source_id" ))
444+ # TODO@bensteUEM: only some parameters can be applied
445+ # CT support case 147728
446+ # https://github.com/bensteUEM/ChurchToolsAPI/issues/144
447+ """
448+ if isinstance(kwargs.get("source_name"), int):
449+ source_name = kwargs.get("source_name")
450+ elif isinstance(kwargs.get("source_name"), str):
451+ source_name = self.lookup_song_source_as_id(
452+ shortname=kwargs.get("source_name")
453+ )
442454 else:
443- source_id = self .lookup_song_source_as_id (
455+ source_name = self.lookup_song_source_as_id(
444456 shortname=existing_arrangement["sourceName"]
445457 )
446-
458+ """
459+ if kwargs .get ("source_name" ) or kwargs .get ("source_reference" ):
460+ logger .warning (
461+ "CT support cas 147728 source_name and reference are "
462+ "not updateabel via REST API"
463+ )
464+ # TODO@bensteUEM: only some parameters can be applied
465+ # CT support case 147728
466+ # https://github.com/bensteUEM/ChurchToolsAPI/issues/144
467+ """
468+ "sourceName": source_name,
469+ "sourceReference": kwargs.get(
470+ "source_reference", existing_arrangement["sourceReference"]
471+ ),
472+ """
447473 data = {
448474 "name" : kwargs .get ("name" , existing_arrangement ["name" ]),
449475 "key" : kwargs .get ("key" , existing_arrangement ["key" ]),
0 commit comments