Spaces:
Paused
Paused
Commit ·
d1a4179
1
Parent(s): 47503fe
Added support for dynamic playlist length
Browse files- Functions/video_player_functions.py +4 -0
- app.py +3 -2
Functions/video_player_functions.py
CHANGED
|
@@ -34,3 +34,7 @@ def get_video_link_by_pointer(pointer, show_incomplete_only):
|
|
| 34 |
|
| 35 |
def change_video_completion_status(is_complete, video_pointer):
|
| 36 |
default_app.database().child("videos").child(str(video_pointer)).child("complete").set(is_complete)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
def change_video_completion_status(is_complete, video_pointer):
|
| 36 |
default_app.database().child("videos").child(str(video_pointer)).child("complete").set(is_complete)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def get_number_of_videos():
|
| 40 |
+
return len(default_app.database().child("videos").get().val())
|
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
-
from Functions.video_player_functions import youtube_link_to_id, get_video_link_by_pointer, get_youtube_player_html,
|
|
|
|
| 4 |
from Functions.caption_editor_functions import request_captions_by_video_id, save_captions_to_db
|
| 5 |
from Resources.css import css
|
| 6 |
from Resources.js import yt_init_js
|
|
@@ -8,7 +9,7 @@ from Resources.localization import get_string
|
|
| 8 |
|
| 9 |
next_video_pointer = 0
|
| 10 |
user = "anonymous_user"
|
| 11 |
-
n_videos =
|
| 12 |
placeholder_link = "https://www.youtube.com/watch?v=wTQjwG2-ePA"
|
| 13 |
|
| 14 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
+
from Functions.video_player_functions import (youtube_link_to_id, get_video_link_by_pointer, get_youtube_player_html,
|
| 4 |
+
change_video_completion_status, get_number_of_videos)
|
| 5 |
from Functions.caption_editor_functions import request_captions_by_video_id, save_captions_to_db
|
| 6 |
from Resources.css import css
|
| 7 |
from Resources.js import yt_init_js
|
|
|
|
| 9 |
|
| 10 |
next_video_pointer = 0
|
| 11 |
user = "anonymous_user"
|
| 12 |
+
n_videos = get_number_of_videos()
|
| 13 |
placeholder_link = "https://www.youtube.com/watch?v=wTQjwG2-ePA"
|
| 14 |
|
| 15 |
|