at least one fallback, even if edit
This commit is contained in:
parent
cf9dffb05c
commit
18a199d609
@ -71,7 +71,8 @@ class PlaylistController(ObController):
|
||||
id=request.form['id'],
|
||||
name=request.form['name'],
|
||||
time_sync=True if 'time_sync' in request.form else False,
|
||||
enabled=True if 'enabled' in request.form else False
|
||||
enabled=True if 'enabled' in request.form else False,
|
||||
fallback=True if self._model_store.playlist().count_fallbacks() == 0 else None
|
||||
)
|
||||
return redirect(url_for('playlist_list', playlist_id=request.form['id']))
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ GROUP BY playlist_id;
|
||||
def post_delete(self, playlist_id: str) -> str:
|
||||
return playlist_id
|
||||
|
||||
def update_form(self, id: int, name: Optional[str] = None, time_sync: Optional[bool] = None, enabled: Optional[bool] = None) -> None:
|
||||
def update_form(self, id: int, name: Optional[str] = None, time_sync: Optional[bool] = None, enabled: Optional[bool] = None, fallback: Optional[bool] = None) -> None:
|
||||
playlist = self.get(id)
|
||||
|
||||
if not playlist:
|
||||
@ -173,6 +173,7 @@ GROUP BY playlist_id;
|
||||
"name": name if isinstance(name, str) else playlist.name,
|
||||
"time_sync": time_sync if isinstance(time_sync, bool) else playlist.time_sync,
|
||||
"enabled": enabled if isinstance(enabled, bool) else playlist.enabled,
|
||||
"fallback": fallback if isinstance(fallback, bool) else playlist.fallback,
|
||||
}
|
||||
|
||||
if name != playlist.name:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user