PROGRAM NOTES for Cynthia. DRAFT v.1.0.1 - 16-03-22. Sugested method of refering functionality details to 'notes'. ## Please refer to the NOTES: for each 'def' in 'cynthia-notes.txt' ## for details about each of the individual functions in 'cynthia.py'. Example: def call_refresh(self): ## NOTE:1 ## CYNTHIA NOTES def call_refresh(self): ## NOTE:1 - Euan Morgan's fix for refresh timeout errors. def repopulate_the_queue(self): ## The various processes start here. def get_queue_count(self): ## NOTE:2 - Fetch the total number of tracks currently in the Endless QUEUE playlist. def get_the_queue_again(self): ## NOTE:3 Reload all of the tracks in QUEUE for further processing. def get_the_queue(self): ## NOTE:4 - Get Details of each track in the Endless QUEUE playlist and add them it a [list]. def sort_out_the_queue_track_name(self): ## NOTE:5: 1. Read the track title up to the hyphen '-' to see if one exists. 2. Strip the white space from both ends of the string: 'self.track_name'. 3. Apply upper-case capitalisation to all characters. 4. Do the same to both the QUEUE track and the Recently Played track. 5. Compare the 2 and hope they are a match and then can be dealt with accordingly. 6. Use the matched tracks with those in the QUEUE to grab the real track URI. def check_played_list(self): ## NOTE:6 - Get Last 50 played tracks and check to see if each one is in the Endless QUEUE playlist. Keep just the one Recently Played track in the Endless QUEUE, just incase it was only partially played. def sort_out_the_last_played_track_name(self): ## NOTE:7 - Uses the same method as in ## NOTE:5. def mark_played_and_remove(self): ## NOTE:8 - If the track is in the Endless QUEUE playlist AND it has been played then, 'Mark' the played tracks in the database. and Remove played tracks from the Endless QUEUE playlist. def get_endless_playlist(self): ## NOTE:9 - Get the Endless Playlist Name def mark_played_in_db(self): ## NOTE:10 - Mark the played tracks in the database, as in NOTE:7. def remove_from_playlist(self): ## NOTE:11 - Remove played tracks from the Endless QUEUE playlist, as in NOTE:7. def get_new_tracks(self): ## NOTE:12 - Calculate the number of new tracks required in order to maintain the Endless QUEUE playlist, if the total is less than 50. def get_tracks(self): ## NOTE:13 - Select, at random, from any of the those not yet played tracks from the database, to fulfill the 50 max in the Endless QUEUE playlist. def set_played_flag(self): ## NOTE:14 - Set the 'played' flag in the database from '0' to '1' for the newly added QUEUE tracks. def add_track_to_queue(self): ## NOTE:15 - Now add the new tracks to the Endless Queue Playlist. def check_played_count(self): ## NOTE:16 - Interrogate the database to check the number of tracks that are still yet to get played [un-played]. def reset_played_flag(self): ## NOTE:17 - If there are no tracks left [un-played], then 'reset' the database 'played' flag, thus making all of the tracks available for random selection for adding to the QUEUE again.