You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
📝 Add docstrings to pre-for-piers-and-use-playback-class
Docstrings generation was requested by @bossanova808.
* #9 (comment)
The following files were modified:
* `resources/lib/monitor.py`
* `resources/lib/playback_resumer.py`
* `resources/lib/player.py`
Copy file name to clipboardExpand all lines: resources/lib/playback_resumer.py
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,14 @@
11
11
12
12
defrun():
13
13
"""
14
-
This is 'main'
15
-
16
-
:return:
14
+
Start the addon: initialize logging and global state, configure Kodi monitor and player, attempt to resume or start playback, then run the main event loop until an abort is requested.
15
+
16
+
This function:
17
+
- Starts the logger and creates the global Store.
18
+
- Instantiates and stores Kodi event monitor and player objects.
19
+
- Attempts to resume previous playback; if nothing resumed and no video is playing, triggers autoplay when enabled.
20
+
- Enters a loop that waits for an abort request and exits when one is detected.
21
+
- Stops the logger before returning.
17
22
"""
18
23
Logger.start()
19
24
# load settings and create the store for our globals
Automatically resume a video after a crash, if one was playing...
233
-
234
-
:return:
254
+
Attempt to resume playback after a previous shutdown if resuming is enabled and saved resume data exist.
255
+
256
+
If configured and valid resume data are present, the player will start the saved file and seek to the stored resume time; on any failure or if no resume data are applicable, no playback is resumed.
257
+
258
+
Returns:
259
+
True if playback was resumed and seeked to the saved position, False otherwise.
Selects a random video file path from the Kodi library.
300
+
301
+
Chooses among episodes, movies, and music videos and returns the file path of a randomly selected item if one exists. Updates Store.video_types_in_library to reflect whether a given type is present. If the library contains no eligible videos, no selection is made.
302
+
303
+
Returns:
304
+
str: File path of the selected video.
305
+
False: If no episodes, movies, or music videos exist in the library.
0 commit comments