more sse, disable sse, disable auto-refresh if compelted

This commit is contained in:
Carl Pearson
2024-10-21 06:04:22 -06:00
parent 6cea35c699
commit 34fa95aa05
7 changed files with 169 additions and 25 deletions

View File

@@ -716,11 +716,20 @@ func videosHandler(c echo.Context) error {
var origs []originals.Original
db.Where("user_id = ?", userID).Order("id DESC").Find(&origs)
refresh := false
for _, orig := range origs {
if orig.Status != "completed" {
refresh = true
break
}
}
var playlists []playlists.Playlist
db.Where("user_id = ?", userID).Order("id DESC").Find(&playlists)
return c.Render(http.StatusOK, "videos.html",
map[string]interface{}{
"refresh": refresh,
"videos": origs,
"playlists": playlists,
"Footer": handlers.MakeFooter(),