Skip to content

Commit 9451925

Browse files
committed
refactor: remove unused day/night video position tracking code
1 parent 089ab5e commit 9451925

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

package/contents/config/main.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,9 @@
111111
<entry name="LastVideoDay" type="String">
112112
<default></default>
113113
</entry>
114-
<entry name="LastVideoDayPosition" type="Int">
115-
<default>0</default>
116-
</entry>
117114
<entry name="LastVideoNight" type="String">
118115
<default></default>
119116
</entry>
120-
<entry name="LastVideoNightPosition" type="Int">
121-
<default>0</default>
122-
</entry>
123117
<!-- Mute audio
124118
0: when maximized or full-screen windows
125119
1: when a visible window is active

package/contents/ui/main.qml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,10 @@ WallpaperItem {
4949
}
5050

5151
function getLastVideo() {
52-
let lastVideo = main.configuration.LastVideo;
5352
if (dayNightCycle) {
54-
lastVideo = main.configuration[isDay ? "LastVideoDay" : "LastVideoNight"];
53+
return main.configuration[isDay ? "LastVideoDay" : "LastVideoNight"];
5554
}
56-
return lastVideo;
57-
}
58-
function getLastVideoPosition() {
59-
let lastVideoPosition = main.configuration.LastVideoPosition;
60-
if (dayNightCycle) {
61-
lastVideoPosition = main.configuration[isDay ? "LastVideoDayPosition" : "LastVideoNightPosition"];
62-
}
63-
return lastVideoPosition;
55+
return main.configuration.LastVideo;
6456
}
6557
function getLastVideoIndex() {
6658
const lastVideo = getLastVideo();
@@ -365,7 +357,7 @@ WallpaperItem {
365357
id: player
366358
anchors.fill: parent
367359
muted: main.muteAudio
368-
lastVideoPosition: main.getLastVideoPosition()
360+
lastVideoPosition: main.configuration.LastVideoPosition
369361
visible: main.videosConfig.length !== 0
370362
onSetNextSource: {
371363
main.nextVideo();
@@ -548,7 +540,6 @@ WallpaperItem {
548540
main.configuration.LastVideoPosition = player.lastVideoPosition;
549541
if(dayNightCycle) {
550542
main.configuration[main.isDay ? "LastVideoDay" : "LastVideoNight"] = main.currentSource.filename;
551-
main.configuration[main.isDay ? "LastVideoDayPosition" : "LastVideoNightPosition"] = player.lastVideoPosition;
552543
}
553544
main.configuration.writeConfig();
554545
printLog("Bye!");

0 commit comments

Comments
 (0)