From e4b0f3ec5620da6b5fe9db0aebda30138746d63b Mon Sep 17 00:00:00 2001 From: Everett Summer <55684557+EverettSummer@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:19:24 +0000 Subject: [PATCH 1/2] Add dropdown menu to change episode watch status. update Deneb-UI to 4.4.0. --- package-lock.json | 19 ++++++------ package.json | 2 +- src/app/admin/admin.module.ts | 29 ++++++++++++------- src/app/admin/bangumi-card/bangumi-card.html | 4 +-- .../admin/bangumi-detail/bangumi-detail.html | 8 ++--- src/app/home/bangumi-card/bangumi-card.html | 4 +-- .../bangumi-detail.components.ts | 13 +++++++++ .../home/bangumi-detail/bangumi-detail.html | 19 ++++++++---- .../home/bangumi-detail/bangumi-detail.less | 12 ++++++++ src/app/home/default/default.html | 8 ++--- src/app/home/home.module.ts | 20 ++++++++----- .../play-episode/comment/comment.component.ts | 5 ++-- src/app/home/play-episode/play-episode.html | 4 +-- .../edit-review-dialog.html | 4 +-- src/app/home/watch.service.ts | 8 +++++ 15 files changed, 106 insertions(+), 53 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d42052..5474365 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mira-ui", - "version": "2.10.1", + "version": "2.10.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mira-ui", - "version": "2.10.1", + "version": "2.10.2", "dependencies": { "@angular/animations": "^18.1.0", "@angular/cdk": "^18.1.0", @@ -18,7 +18,7 @@ "@angular/platform-browser-dynamic": "^18.1.0", "@angular/router": "^18.1.0", "@egjs/agent": "^2.4.0", - "@irohalab/deneb-ui": "^4.0.1", + "@irohalab/deneb-ui": "^4.4.0", "@irohalab/semantic-ui": "^2.4.1", "@swimlane/ngx-graph": "^8.4.0", "d3-scale": "^4.0.2", @@ -3925,9 +3925,10 @@ } }, "node_modules/@irohalab/deneb-ui": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@irohalab/deneb-ui/-/deneb-ui-4.0.1.tgz", - "integrity": "sha512-Dw492iU5bUNjvrQIKpxzceJgegrFWPjCM6dW+qkD5Ry47FA6wnuMaeRGvf6aLksmgUjtdTF+VAF5EgqsZilECw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@irohalab/deneb-ui/-/deneb-ui-4.4.0.tgz", + "integrity": "sha512-5LPDo+3cDG66yMfdusr4R/ItkjkMH8ZuP0Le/JQSSKYl0UaL90Ym6+7jFy+4ozayHWhWxVqRHrbWmQ9EzPue6g==", + "license": "Apache-2.0", "dependencies": { "tslib": "^2.3.0" }, @@ -16631,9 +16632,9 @@ } }, "@irohalab/deneb-ui": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@irohalab/deneb-ui/-/deneb-ui-4.0.1.tgz", - "integrity": "sha512-Dw492iU5bUNjvrQIKpxzceJgegrFWPjCM6dW+qkD5Ry47FA6wnuMaeRGvf6aLksmgUjtdTF+VAF5EgqsZilECw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@irohalab/deneb-ui/-/deneb-ui-4.4.0.tgz", + "integrity": "sha512-5LPDo+3cDG66yMfdusr4R/ItkjkMH8ZuP0Le/JQSSKYl0UaL90Ym6+7jFy+4ozayHWhWxVqRHrbWmQ9EzPue6g==", "requires": { "tslib": "^2.3.0" } diff --git a/package.json b/package.json index b15687d..0a587a8 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@angular/platform-browser-dynamic": "^18.1.0", "@angular/router": "^18.1.0", "@egjs/agent": "^2.4.0", - "@irohalab/deneb-ui": "^4.0.1", + "@irohalab/deneb-ui": "^4.4.0", "@irohalab/semantic-ui": "^2.4.1", "@swimlane/ngx-graph": "^8.4.0", "d3-scale": "^4.0.2", diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 8cc1372..b2a7037 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -15,7 +15,7 @@ import { adminRoutes } from './admin.routes'; import { FeedService } from './bangumi-detail/feed.service'; import { AdminNavbar } from './admin-navbar/admin-navbar.component'; import { BangumiCard } from './bangumi-card/bangumi-card.component'; -import { UIModule } from '@irohalab/deneb-ui'; +import { ResponsiveGenerateSrcService, SRC_GENERATOR_SERVICE, UIModule } from '@irohalab/deneb-ui'; import { BangumiTypeNamePipe } from './bangumi-pipes/type-name-pipe'; import { ResultDetail } from './search-bangumi/result-detail/result-detail.component'; import { BangumiBasic } from './bangumi-detail/bangumi-basic/bangumi-basic.component'; @@ -32,7 +32,6 @@ import { UserManagerSerivce } from './user-manager/user-manager.service'; import { UserPromoteModal } from './user-manager/user-promote-modal/user-promote-modal.component'; import { DenebCommonPipes } from '../pipes'; import { VideoFileModal } from './bangumi-detail/video-file-modal/video-file-modal.component'; -import { ResponsiveImageModule } from '../responsive-image/responsive-image.module'; import { AnnounceComponent } from './announce/announce.component'; import { EditAnnounceComponent } from './announce/edit-announce/edit-announce.component'; import { AnnounceService } from './announce/announce.service'; @@ -47,8 +46,12 @@ import { NyaaPipe } from './bangumi-pipes/nyaa-pipe'; import { EditBangumiRecommendComponent } from './announce/edit-bangumi-recommend/edit-bangumi-recommend.component'; import { VideoProcessRuleComponent } from './bangumi-detail/video-processs-rule/video-process-rule.component'; import { VideoProcessRuleService } from './bangumi-detail/video-processs-rule/video-process-rule.service'; -import { VideoProcessRuleEditorComponent } from './bangumi-detail/video-processs-rule/video-process-rule-editor/video-process-rule-editor.component'; -import { VideoProcessRuleItemComponent } from './bangumi-detail/video-processs-rule/video-process-rule-item/video-process-rule-item.component'; +import { + VideoProcessRuleEditorComponent +} from './bangumi-detail/video-processs-rule/video-process-rule-editor/video-process-rule-editor.component'; +import { + VideoProcessRuleItemComponent +} from './bangumi-detail/video-processs-rule/video-process-rule-item/video-process-rule-item.component'; import { ActionTypePipe } from './bangumi-detail/video-processs-rule/action-type.pipe'; import { ProfileTypePipe } from './bangumi-detail/video-processs-rule/profile-type.pipe'; import { DownloadManagerComponent } from './download-manager/download-manager.component'; @@ -68,7 +71,8 @@ import { DownloadJobDetailComponent } from './download-manager/download-job-deta import { DownloadEditorComponent } from './bangumi-detail/universal-builder/download-editor/download-editor.component'; -@NgModule({ declarations: [ +@NgModule({ + declarations: [ Admin, SearchBangumi, ResultDetail, @@ -114,17 +118,20 @@ import { DownloadEditorComponent } from './bangumi-detail/universal-builder/down VertexInfoPanelComponent, DownloadJobDetailComponent, DownloadEditorComponent - ], imports: [CommonModule, + ], + imports: [ + CommonModule, FormsModule, ReactiveFormsModule, RouterModule.forChild(adminRoutes), UIModule, ConfirmDialogModule, DenebCommonPipes, - ResponsiveImageModule, UserServiceModule, DpDatePickerModule, - NgxGraphModule], providers: [ + NgxGraphModule + ], + providers: [ AdminService, FeedService, BangumiMoeService, @@ -136,7 +143,9 @@ import { DownloadEditorComponent } from './bangumi-detail/universal-builder/down VideoProcessRuleService, DownloadManagerService, VideoProcessManagerService, - provideHttpClient(withInterceptorsFromDi()) - ] }) + provideHttpClient(withInterceptorsFromDi()), + {provide: SRC_GENERATOR_SERVICE, useClass: ResponsiveGenerateSrcService} + ], +}) export class AdminModule { } diff --git a/src/app/admin/bangumi-card/bangumi-card.html b/src/app/admin/bangumi-card/bangumi-card.html index f55d9bd..42c673a 100644 --- a/src/app/admin/bangumi-card/bangumi-card.html +++ b/src/app/admin/bangumi-card/bangumi-card.html @@ -1,6 +1,6 @@
- - +
image
diff --git a/src/app/admin/bangumi-detail/bangumi-detail.html b/src/app/admin/bangumi-detail/bangumi-detail.html index d7c3993..432e778 100644 --- a/src/app/admin/bangumi-detail/bangumi-detail.html +++ b/src/app/admin/bangumi-detail/bangumi-detail.html @@ -15,14 +15,14 @@
- + [background]="bangumi.cover_image.dominant_color">

@@ -187,7 +187,7 @@

- originalWidth: episode.thumbnail_image.width, originalHeight: episode.thumbnail_image.height}" display="table" *ngIf="episode.status === 2 && !!episode.thumbnail_image" - [background]="episode.thumbnail_image.dominant_color"> + [background]="episode.thumbnail_image.dominant_color"> 日文:{{episode.name}}
diff --git a/src/app/home/bangumi-card/bangumi-card.html b/src/app/home/bangumi-card/bangumi-card.html index c8d1672..f1725b1 100644 --- a/src/app/home/bangumi-card/bangumi-card.html +++ b/src/app/home/bangumi-card/bangumi-card.html @@ -1,7 +1,7 @@
- + >

{{bangumi.name_cn || '暂无'}}

diff --git a/src/app/home/bangumi-detail/bangumi-detail.components.ts b/src/app/home/bangumi-detail/bangumi-detail.components.ts index c993ab9..ececb98 100644 --- a/src/app/home/bangumi-detail/bangumi-detail.components.ts +++ b/src/app/home/bangumi-detail/bangumi-detail.components.ts @@ -116,6 +116,19 @@ export class BangumiDetail extends HomeChild implements OnInit, OnDestroy { ); } + changeEpStatus(episode: Episode, status: number): void { + this._subscription.add( + this._watchService.favorite_favorite( + episode.bangumi_id, + episode.id, + status) + .subscribe(() => { + episode.watch_progress.watch_status = status; + this._toastRef.show('已更新'); + }) + ); + } + changeLayoutType(layoutType: string): void { this.layoutType = layoutType; this._persistStorage.setItem(LAYOUT_TYPE, layoutType); diff --git a/src/app/home/bangumi-detail/bangumi-detail.html b/src/app/home/bangumi-detail/bangumi-detail.html index 623b7d9..4c5215e 100644 --- a/src/app/home/bangumi-detail/bangumi-detail.html +++ b/src/app/home/bangumi-detail/bangumi-detail.html @@ -4,13 +4,13 @@
- + [background]="bangumi.cover_image.dominant_color">
@@ -79,13 +79,13 @@

- + [background]="episode.thumbnail_image.dominant_color">
@@ -98,6 +98,13 @@

即将播出

+
{{episode.name_cn || episode.name}}
- + [background]="episode.thumbnail_image.dominant_color"> {{episode.episode_no}} diff --git a/src/app/home/bangumi-detail/bangumi-detail.less b/src/app/home/bangumi-detail/bangumi-detail.less index 5f60766..8ebd8a9 100644 --- a/src/app/home/bangumi-detail/bangumi-detail.less +++ b/src/app/home/bangumi-detail/bangumi-detail.less @@ -256,6 +256,7 @@ flex: 0 0 8rem; } > .content { + flex: 1 0 auto; padding: 0.7em 1em; .extra-info { margin-top: 0.2em; @@ -282,5 +283,16 @@ } } } + .extend-menu-button { + align-self: center; + display: inline-block; + padding: 0.7em 0.2em 0.7em 0.5em; + cursor: pointer; + color: #4c4c4c; + &:focus, + &:hover { + color: #101010; + } + } } } \ No newline at end of file diff --git a/src/app/home/default/default.html b/src/app/home/default/default.html index e636eee..20d7d93 100644 --- a/src/app/home/default/default.html +++ b/src/app/home/default/default.html @@ -10,13 +10,13 @@
- + [background]="announce.bangumi.cover_image.dominant_color">
- + [background]="bangumi.cover_image.dominant_color">
- + [background]="episode.bangumi.cover_image.dominant_color">

diff --git a/src/app/home/rating/edit-review-dialog/edit-review-dialog.html b/src/app/home/rating/edit-review-dialog/edit-review-dialog.html index 19fc1cc..98fcbbd 100644 --- a/src/app/home/rating/edit-review-dialog/edit-review-dialog.html +++ b/src/app/home/rating/edit-review-dialog/edit-review-dialog.html @@ -6,13 +6,13 @@

- + [background]="bangumi.cover_image.dominant_color">
{{bangumi.name_cn}}
diff --git a/src/app/home/watch.service.ts b/src/app/home/watch.service.ts index f4b8959..e8f51b3 100644 --- a/src/app/home/watch.service.ts +++ b/src/app/home/watch.service.ts @@ -45,6 +45,14 @@ export class WatchService extends BaseService { catchError(this.handleError),); } + favorite_favorite(bangumiId: string, episodeId: string, watchStatus: number): Observable { + return this._http.post(`${this._baseUrl}/favorite/episode/${episodeId}`, { + bangumi_id: bangumiId, + status: watchStatus, + }).pipe( + catchError(this.handleError),); + } + episode_history(bangumi_id: string, episode_id: string, last_watch_position: number, percentage: number, is_finished: boolean): Observable { return this._http.post(`${this._baseUrl}/history/${episode_id}`, { bangumi_id: bangumi_id, From 91f6de5bb20d68a12478fd65b8fc89d29c90c27b Mon Sep 17 00:00:00 2001 From: Everett Summer <55684557+EverettSummer@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:42:10 +0000 Subject: [PATCH 2/2] bump version to 2.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0a587a8..197a0fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mira-ui", - "version": "2.10.2", + "version": "2.11.0", "scripts": { "ng": "ng", "start": "ng serve",