diff options
| author | RblSb <msrblsb@gmail.com> | 2025-03-25 03:02:03 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2025-03-25 08:16:04 +0300 |
| commit | f874dcd3de368e7e512ab1c0defdd17bc3026ce5 (patch) | |
| tree | 74fecdf08577f2fc03b09b1170b9ffea9163af04 /src/VideoList.hx | |
| parent | 8ee20a84cb35968f9247028a6a2daa57f04e90bb (diff) | |
Initial cache support for raw videos
m3u8 videos are cached without downloading segments, only m3u8 file is downloaded and segment links are updated to use synctube proxy, so you can add video to playlist as server, ignoring ip restrictions, and stream it to everyone
Diffstat (limited to 'src/VideoList.hx')
| -rw-r--r-- | src/VideoList.hx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/VideoList.hx b/src/VideoList.hx index eb3e67d..852c5e5 100644 --- a/src/VideoList.hx +++ b/src/VideoList.hx @@ -52,13 +52,12 @@ class VideoList { return items.exists(f); } + public function find(f:(item:VideoItem) -> Bool):Null<VideoItem> { + return items.find(f); + } + public function findIndex(f:(item:VideoItem) -> Bool):Int { - var i = 0; - for (v in items) { - if (f(v)) return i; - i++; - } - return -1; + return items.findIndex(f); } public function addItem(item:VideoItem, atEnd:Bool):Void { |
