subbed indicator in player, subbed count in stats
This commit is contained in:
7
build.ts
7
build.ts
@@ -89,6 +89,8 @@ let music_vars: MusicVars[] = [];
|
|||||||
let songs: string[] = [];
|
let songs: string[] = [];
|
||||||
let manga_pages_count: number = 0;
|
let manga_pages_count: number = 0;
|
||||||
|
|
||||||
|
let subbed_songs = [];
|
||||||
|
|
||||||
for (let i = 0; i < listings.length; i++) {
|
for (let i = 0; i < listings.length; i++) {
|
||||||
const listing: Listing = listings[i];
|
const listing: Listing = listings[i];
|
||||||
directory_serve_paths.push(`/${listing.type}/${listing.name}`);
|
directory_serve_paths.push(`/${listing.type}/${listing.name}`);
|
||||||
@@ -129,6 +131,9 @@ for (let i = 0; i < listings.length; i++) {
|
|||||||
music_vars.push({
|
music_vars.push({
|
||||||
...base,
|
...base,
|
||||||
});
|
});
|
||||||
|
if (existsSync(path.join(__dirname, `/static_assets/music_subtitle_assets/${listing.name}/${chapter}.vtt`))) {
|
||||||
|
subbed_songs.push(`${listing.name}/${chapter}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -147,6 +152,7 @@ builder.serve_template(renderer, "/stats", "stats", {
|
|||||||
anime_episodes_count: anime_serve_paths.length,
|
anime_episodes_count: anime_serve_paths.length,
|
||||||
artists_count: listings.filter((l) => l.type === "music").length,
|
artists_count: listings.filter((l) => l.type === "music").length,
|
||||||
songs_count: songs.length,
|
songs_count: songs.length,
|
||||||
|
sub_count: subbed_songs.length,
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.serve_template(renderer, "/player", "player", {
|
builder.serve_template(renderer, "/player", "player", {
|
||||||
@@ -163,6 +169,7 @@ builder.serve_template(renderer, "/player", "player", {
|
|||||||
//I don't think " can be in file names... but just in case
|
//I don't think " can be in file names... but just in case
|
||||||
sanitized_name: song.slice(`${l.name}/`.length).replaceAll("\"", "\\\""),
|
sanitized_name: song.slice(`${l.name}/`.length).replaceAll("\"", "\\\""),
|
||||||
favourite: l.favourites.chapters.includes(song.slice(`${l.name}/`.length)),
|
favourite: l.favourites.chapters.includes(song.slice(`${l.name}/`.length)),
|
||||||
|
subbed: subbed_songs.includes(song),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
<div id="[[ artist.sanitized_name ]]-song-filter" class="artist-song-filter">
|
<div id="[[ artist.sanitized_name ]]-song-filter" class="artist-song-filter">
|
||||||
[[ for:artist.songs:song ]]
|
[[ for:artist.songs:song ]]
|
||||||
<input type="checkbox" id="[[ artist.sanitized_name ]]-[[ song.sanitized_name ]]-checkbox" onchange="update_playable_songs()"/>
|
<input type="checkbox" id="[[ artist.sanitized_name ]]-[[ song.sanitized_name ]]-checkbox" onchange="update_playable_songs()"/>
|
||||||
<label for="[[ artist.sanitized_name ]]-[[ song.sanitized_name ]]-checkbox">[[ if:song.favourite ]]★[[ endif ]][[ song.name ]] <button class="add-to-queue-btns" onclick="add_to_queue('[[ artist.sanitized_name ]]/[[ song.sanitized_name ]]')">Add to Queue</button></label>
|
<label for="[[ artist.sanitized_name ]]-[[ song.sanitized_name ]]-checkbox">[[ if:song.favourite ]]★[[ endif ]][[ song.name ]][[ if:song.subbed ]] (subbed)[[ endif ]] <button class="add-to-queue-btns" onclick="add_to_queue('[[ artist.sanitized_name ]]/[[ song.sanitized_name ]]')">Add to Queue</button></label>
|
||||||
[[ endfor ]]
|
[[ endfor ]]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<h3>Anime episodes: [[ anime_episodes_count ]]</h3>
|
<h3>Anime episodes: [[ anime_episodes_count ]]</h3>
|
||||||
<h3>Music Artists: [[ artists_count ]]</h3>
|
<h3>Music Artists: [[ artists_count ]]</h3>
|
||||||
<h3>Songs: [[ songs_count ]]</h3>
|
<h3>Songs: [[ songs_count ]]</h3>
|
||||||
|
<h3>Subtitled Songs: [[ sub_count ]]</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user