allow for udpating video and pres titles

This commit is contained in:
Chris Cochrun 2022-09-28 11:26:28 -05:00
parent a43a2ab39b
commit f69d17d08b
2 changed files with 26 additions and 2 deletions

View file

@ -140,7 +140,7 @@ Item {
placeholderText: "Song Title..."
text: video.title
padding: 10
/* onEditingFinished: updateTitle(text); */
onEditingFinished: updateTitle(text);
}
RowLayout {
@ -275,4 +275,16 @@ Item {
videoPreview.pause();
print("quit mpv");
}
function updateTitle(text) {
changeTitle(text, false);
videosqlmodel.updateTitle(video.id, text);
showPassiveNotification(video.title);
}
function changeTitle(text, updateBox) {
if (updateBox)
videoTitleField.text = text;
video.title = text;
}
}