Skip to content

Usenet streaming with a WebDAV server and a SABnzbd-compatible API

C#

Fixed rendering of video icons in Explore page.

nzbdav-dev39affab30448
diff --git a/frontend/app/routes/explore/route.module.css b/frontend/app/routes/explore/route.module.css
index 0faa2290..813ac9d2 100644
--- a/frontend/app/routes/explore/route.module.css
+++ b/frontend/app/routes/explore/route.module.css
@@ -69,21 +69,23 @@
}
.video-icon {
- display: inline-block;
- width: 40px;
- height: 40px;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%2393a1a1' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M39 6H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h30a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3'/%3E%3Cpath fill='%2393a1a1' d='M20.5 28v-6.062l5.25 3.03L31 28l-5.25 3.031l-5.25 3.031z'/%3E%3Cpath d='M6 15h36m-9-9l-6 9m-6-9l-6 9'/%3E%3C/g%3E%3C/svg%3E");
+ flex-shrink: 0;
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%2393a1a1' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M39 6H9a3 3 0 0 0-3 3v30a3 3 0 0 0 3 3h30a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3'/%3E%3Cpath fill='%2393a1a1' d='M20.5 28v-6.062l5.25 3.03L31 28l-5.25 3.031l-5.25 3.031z'/%3E%3Cpath d='M6 15h36m-9-9l-6 9m-6-9l-6 9'/%3E%3C/g%3E%3C/svg%3E");
}
.image-icon {
- display: inline-block;
- width: 40px;
- height: 35px;
- background-repeat: no-repeat;
- background-size: 100% 100%;
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='%2393a1a1'%3E%3Cpath d='M6.002 5.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0'/%3E%3Cpath d='M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71l-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1z'/%3E%3C/g%3E%3C/svg%3E");
+ flex-shrink: 0;
+ display: inline-block;
+ width: 40px;
+ height: 35px;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='%2393a1a1'%3E%3Cpath d='M6.002 5.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0'/%3E%3Cpath d='M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71l-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1z'/%3E%3C/g%3E%3C/svg%3E");
}
.item-info {
diff --git a/frontend/app/routes/explore/route.tsx b/frontend/app/routes/explore/route.tsx
index 21c8427e..63a7663d 100644
--- a/frontend/app/routes/explore/route.tsx
+++ b/frontend/app/routes/explore/route.tsx
@@ -102,6 +102,7 @@ function getExtension(filename: string): string | undefined {
function getIcon(file: ExploreFile) {
if (file.name.toLowerCase().endsWith(".mkv")) return styles["video-icon"];
+ if (file.mimeType === "application/mp4") return styles["video-icon"];
if (file.mimeType && file.mimeType.startsWith("video")) return styles["video-icon"];
if (file.mimeType && file.mimeType.startsWith("image")) return styles["image-icon"];
return styles["file-icon"];