Youtube dan indirilen videoların kategorisi müzik mi değil mi tespit edilebiliyor! İkonlar buna göre gösteriliyor.
This commit is contained in:
@@ -85,6 +85,7 @@
|
||||
return {
|
||||
...file,
|
||||
isDirectory,
|
||||
mediaCategory: file.mediaCategory || null,
|
||||
hiddenRoot,
|
||||
originalSegments,
|
||||
displaySegments,
|
||||
@@ -97,7 +98,13 @@
|
||||
function buildDirectoryEntries(fileList) {
|
||||
const directories = new Map();
|
||||
|
||||
const ensureDirectoryEntry = (key, displayName, parentDisplayPath, originalPath) => {
|
||||
const ensureDirectoryEntry = (
|
||||
key,
|
||||
displayName,
|
||||
parentDisplayPath,
|
||||
originalPath,
|
||||
mediaCategory
|
||||
) => {
|
||||
if (!key) return;
|
||||
if (!directories.has(key)) {
|
||||
directories.set(key, {
|
||||
@@ -108,6 +115,7 @@
|
||||
parentDisplayPath,
|
||||
originalPaths: new Set(),
|
||||
isDirectory: true,
|
||||
mediaCategory: mediaCategory || null
|
||||
});
|
||||
}
|
||||
if (originalPath) {
|
||||
@@ -128,7 +136,13 @@
|
||||
const displayPath = segments.join("/");
|
||||
const parentDisplayPath = segments.slice(0, -1).join("/");
|
||||
const displayName = file.displayName || segments[segments.length - 1] || displayPath;
|
||||
ensureDirectoryEntry(displayPath, displayName, parentDisplayPath, fullOriginalPath);
|
||||
ensureDirectoryEntry(
|
||||
displayPath,
|
||||
displayName,
|
||||
parentDisplayPath,
|
||||
fullOriginalPath,
|
||||
file.mediaCategory
|
||||
);
|
||||
}
|
||||
|
||||
if (segments.length <= 1) continue;
|
||||
@@ -2189,16 +2203,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="media-type-icon">
|
||||
{#if entry.type?.startsWith("video/")}
|
||||
{#if entry.seriesEpisode || (entry.seriesEpisodes && Object.keys(entry.seriesEpisodes).length > 0)}
|
||||
<i class="fa-solid fa-tv"></i>
|
||||
{:else if entry.movieMatch}
|
||||
<i class="fa-solid fa-film"></i>
|
||||
{:else}
|
||||
<i class="fa-solid fa-ban"></i>
|
||||
{/if}
|
||||
{:else if entry.type?.startsWith("image/")}
|
||||
{#if entry.type?.startsWith("image/")}
|
||||
<i class="fa-solid fa-image"></i>
|
||||
{:else if entry.mediaCategory === "tv"}
|
||||
<i class="fa-solid fa-tv"></i>
|
||||
{:else if entry.mediaCategory === "movie"}
|
||||
<i class="fa-solid fa-film"></i>
|
||||
{:else if entry.mediaCategory === "music"}
|
||||
<i class="fa-solid fa-music"></i>
|
||||
{:else if entry.type?.startsWith("video/")}
|
||||
<i class="fa-solid fa-play"></i>
|
||||
{:else}
|
||||
<i class="fa-solid fa-file"></i>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user