Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Library favorites: open a creation from elsewhere under All

Bowen Xue38751967a4e2
diff --git a/freevideo_engine/comfy_library.py b/freevideo_engine/comfy_library.py
index d22ec89..590ca99 100644
--- a/freevideo_engine/comfy_library.py
+++ b/freevideo_engine/comfy_library.py
@@ -1250,8 +1250,11 @@ def register():
body.get('id'), body['favorite'])
except (ValueError, TypeError) as error:
raise web.HTTPBadRequest(text=str(error)) from error
- except OSError:
+ except FileNotFoundError:
raise web.HTTPNotFound(text='Saved video unavailable') from None
+ except OSError:
+ # The creation is there but its favorite could not be written; another try may work.
+ raise web.HTTPInternalServerError(text='Could not save the favorite') from None
return web.json_response(result, headers={'Cache-Control': 'no-store'})
@server.routes.get('/freevideo/library/thumbnail')
diff --git a/web/library.js b/web/library.js
index 3828b08..eab223f 100644
--- a/web/library.js
+++ b/web/library.js
@@ -196,8 +196,10 @@ export function openLibrary(t, {upscale = null, selectedWork = null, extend = nu
headerObserver.observe(header); headerObserver.observe(tools);
const body = el('div', null, 'fv-library-body');
const collection = el('section', null, 'fv-library-collection'); collection.setAttribute('aria-label', t('Saved videos', '已保存的视频'));
+ // Opened to show one creation from elsewhere: list all of them this time, so that creation is found
+ // even when it is not a favorite; the saved choice is kept for the next opening.
let favoritesOnly = false;
- try { favoritesOnly = localStorage.getItem(FILTER_KEY) === 'favorites'; } catch { /* Show all. */ }
+ if (!selectedWork) try { favoritesOnly = localStorage.getItem(FILTER_KEY) === 'favorites'; } catch { /* Show all. */ }
const filters = el('div', null, 'fv-pass-mode fv-library-filter');
filters.setAttribute('role', 'radiogroup'); filters.setAttribute('aria-label', t('Show', '显示'));
const filterAll = button(t('All', '全部'), () => changeFilter(false));
@@ -352,12 +354,14 @@ export function openLibrary(t, {upscale = null, selectedWork = null, extend = nu
try {
const response = await api.fetchApi('/freevideo/library/favorite', {method: 'POST',
headers: jsonHeaders, body: JSON.stringify({id, favorite}), signal: abort.signal});
- if (!response.ok) throw new Error('Favorite unavailable');
+ if (!response.ok) throw Object.assign(new Error('Favorite unavailable'), {status: response.status});
const value = await response.json();
if (value.favorite !== favorite) throw new Error('Invalid favorite response');
} catch (error) {
if (!disposed && error.name !== 'AbortError') {
+ // The creation is gone (deleted or moved): trying again cannot help.
const text = isNetworkTypeError(error) ? connectionLostText(t)
+ : error.status === 404 ? videoUnavailableText(t)
: favorite ? t('Could not save the favorite. Try again.', '无法保存收藏,请重试。')
: t('Could not remove the favorite. Try again.', '无法取消收藏,请重试。');
fault(notice, text, ['Favorites', '收藏']);