initial ability to update properties of video_model.rs

I've made it possible to update the properties of the videos. I'll
need to make sure title, start and end times, and paths all work as
well. Let's make videos really good and then move on to images and
presentations.
This commit is contained in:
Chris Cochrun 2023-04-17 11:22:07 -05:00
parent 2311af3b46
commit b037f1a91c
6 changed files with 138 additions and 31 deletions

View file

@ -36,7 +36,7 @@ Item {
libraryType: "song"
headerLabel: "Songs"
itemIcon: "folder-music-symbolic"
itemSubtitle: "hi"
itemSubtitle: model.author
newItemFunction: (function() {
songProxyModel.setFilterRegularExpression("");
songProxyModel.songModel.newSong();
@ -63,12 +63,7 @@ Item {
libraryType: "video"
headerLabel: "Videos"
itemIcon: "folder-videos-symbolic"
itemSubtitle: {
if (fileValidation)
model.path;
else
"file is missing"
}
itemSubtitle: model.path
newItemFunction: (function() {
videoProxyModel.setFilterRegularExpression("");
})
@ -88,12 +83,7 @@ Item {
libraryType: "image"
headerLabel: "Images"
itemIcon: "folder-pictures-symbolic"
itemSubtitle: {
if (fileValidation)
model.path;
else
"file is missing"
}
itemSubtitle: model.path
newItemFunction: (function() {
imageProxyModel.setFilterRegularExpression("");
})
@ -113,12 +103,7 @@ Item {
libraryType: "presentation"
headerLabel: "Presentations"
itemIcon: "x-office-presentation-symbolic"
itemSubtitle: {
if (fileValidation)
model.filePath;
else
"file is missing"
}
itemSubtitle: model.path
newItemFunction: (function() {
presProxyModel.setFilterRegularExpression("");
})

View file

@ -70,7 +70,7 @@ ColumnLayout {
anchors {left: libraryLabel.right
verticalCenter: libraryLabel.verticalCenter
leftMargin: 15}
text: libraryType == "song" ? innerModel.rowCount() : innerModel.count()
text: libraryType == "song" ? innerModel.rowCount() : innerModel.count(innerModel)
color: Kirigami.Theme.disabledTextColor
}

View file

@ -245,28 +245,28 @@ Item {
function updateEndTime(value) {
/* changeStartTime(value, false); */
videosqlmodel.updateEndTime(video.id, value);
videoProxyModel.updateEndTime(video.id, value);
video.endTime = value;
showPassiveNotification(video.endTime);
}
function updateStartTime(value) {
/* changeStartTime(value, false); */
videosqlmodel.updateStartTime(video.id, value);
videoProxyModel.updateStartTime(video.id, value);
video.startTime = value;
showPassiveNotification(video.startTime);
}
function updateTitle(text) {
changeTitle(text, false);
videosqlmodel.updateTitle(video.id, text);
videoProxyModel.updateTitle(video.id, text);
showPassiveNotification(video.title);
}
function updateLoop(value) {
/* changeStartTime(value, false); */
videosqlmodel.updateLoop(video.id, value);
/* video.loop = value; */
let bool = videoProxyModel.updateLoop(video.id, value);
video.loop = value;
showPassiveNotification("Loop changed to: " + video.loop);
}