Fix channels sub count in web app
This commit is contained in:
1 parent
889a502731
commit
ce7f51c403
2 files changed
+18
-1
No files matched your search
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Support for auto-generated channels in Playlet backend
|
||||
|
||||
### Fixed
|
||||
|
||||
- Channels sub count in web app
|
||||
|
||||
### Removed
|
||||
|
||||
- [YouTube.js](https://github.com/LuanRT/YouTube.js) from web app. It is no longer needed, so this reduces app size.
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
export let authorThumbnails: any[] | undefined = undefined;
|
||||
export let channelHandle: string | undefined = undefined;
|
||||
export let subCount: number | undefined = undefined;
|
||||
export let subCountText: string | undefined = undefined;
|
||||
export let videoCountText: string | undefined = undefined;
|
||||
export let authorSubTitle: string | undefined = undefined;
|
||||
|
||||
// svelte-ignore unused-export-let
|
||||
export let type: string = undefined;
|
||||
@@ -15,7 +18,17 @@
|
||||
let modal;
|
||||
|
||||
function getSubCountText() {
|
||||
if (authorSubTitle) {
|
||||
return authorSubTitle;
|
||||
}
|
||||
|
||||
if (isNaN(subCount) || subCount < 0) {
|
||||
if (videoCountText) {
|
||||
return videoCountText;
|
||||
}
|
||||
if (subCountText) {
|
||||
return subCountText;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -32,7 +45,7 @@
|
||||
<div class="card card-compact bg-base-100 shadow-xl border border-neutral">
|
||||
<ChannelThumbnail bind:author bind:authorThumbnails />
|
||||
<div class="card-body">
|
||||
<h3 class="card-title text-base line-clamp-1 min-h-8">{author}</h3>
|
||||
<h3 class="card-title text-base line-clamp-2 min-h-8">{author}</h3>
|
||||
<div>{getSubCountText()}</div>
|
||||
<div>{channelHandle || ""}</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user