feat: initial video wallpaper implementation
C++ / fmt (pull_request) Failing after 10s
C++ / build (pull_request) Failing after 11s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 8s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 35s
Python / verify (pull_request) Failing after 1m32s
Rust / build (pull_request) Successful in 1m0s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 1m4s
C++ / fmt (pull_request) Failing after 10s
C++ / build (pull_request) Failing after 11s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 8s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 35s
Python / verify (pull_request) Failing after 1m32s
Rust / build (pull_request) Successful in 1m0s
Rust / fmt (pull_request) Successful in 36s
Rust / clippy (pull_request) Successful in 1m4s
This commit is contained in:
+26
-1
@@ -18,6 +18,8 @@ Searcher {
|
||||
property string actualCurrent: WallpaperPath.currentWallpaperPath
|
||||
property alias crops: adapter.monitorCrops
|
||||
readonly property string current: showPreview ? previewPath : actualCurrent
|
||||
readonly property string currentThumbnail: thumbnailFor(current)
|
||||
readonly property bool currentIsVideo: isVideoPath(current)
|
||||
property alias monitorCrops: monitorCrops
|
||||
property bool pendingPreviewClear
|
||||
property bool previewColorLock
|
||||
@@ -32,6 +34,29 @@ Searcher {
|
||||
return category;
|
||||
}
|
||||
|
||||
readonly property var videoExts: ["mp4", "mkv", "webm", "avi", "mov", "wmv", "flv", "m4v", "mpg", "mpeg", "3gp", "ogv", "ts", "vob"]
|
||||
|
||||
function isVideoPath(path: string): bool {
|
||||
if (!path)
|
||||
return false;
|
||||
const dot = path.lastIndexOf(".");
|
||||
if (dot < 0)
|
||||
return false;
|
||||
return videoExts.includes(path.slice(dot + 1).toLowerCase());
|
||||
}
|
||||
|
||||
function thumbnailFor(path: string): string {
|
||||
if (!isVideoPath(path))
|
||||
return path;
|
||||
|
||||
for (const entry of root.list) {
|
||||
if (entry.path === path && entry.thumbnailPath)
|
||||
return entry.thumbnailPath;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
function getCrop(screen: string): var {
|
||||
return root.crops[screen];
|
||||
}
|
||||
@@ -125,7 +150,7 @@ Searcher {
|
||||
FileSystemModel {
|
||||
id: wallpapers
|
||||
|
||||
filter: FileSystemModel.Images
|
||||
filter: FileSystemModel.Media
|
||||
path: Config.general.wallpaperPath
|
||||
recursive: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user