Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lordfriend/Deneb
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.0.0
Choose a base ref
...
head repository: lordfriend/Deneb
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 1,342 additions and 622 deletions.
  1. +27 −0 .github/workflows/main.yml
  2. +12 −0 .gitlab-ci.yml
  3. +52 −0 CHANGELOG.md
  4. +3 −1 README.md
  5. +1 −0 config/webpack.prod.js
  6. +16 −15 package.json
  7. +8 −5 src/app/admin/admin.module.ts
  8. +2 −1 src/app/admin/admin.service.ts
  9. +53 −10 src/app/admin/bangumi-detail/bangumi-detail.component.ts
  10. +20 −1 src/app/admin/bangumi-detail/bangumi-detail.html
  11. +6 −0 src/app/admin/bangumi-detail/bangumi-detail.less
  12. +14 −1 src/app/admin/bangumi-detail/{keyword-builder → }/feed.service.ts
  13. +18 −1 src/app/admin/bangumi-detail/keyword-builder/keyword-builder.component.ts
  14. +10 −2 src/app/admin/bangumi-detail/keyword-builder/keyword-builder.html
  15. +31 −0 src/app/admin/bangumi-detail/keyword-builder/keyword-builder.less
  16. +136 −0 src/app/admin/bangumi-detail/universal-builder/universal-builder.component.ts
  17. +55 −0 src/app/admin/bangumi-detail/universal-builder/universal-builder.html
  18. +107 −0 src/app/admin/bangumi-detail/universal-builder/universal-builder.less
  19. +2 −2 src/app/admin/bangumi-pipes/{bangumi-moe-pipe.ts → parse-json.pipe.ts}
  20. +1 −1 src/app/admin/list-bangumi/list-bangumi.html
  21. +12 −8 src/app/browser-extension/chrome-extension.service.ts
  22. +1 −0 src/app/entity/bangumi.ts
  23. +4 −0 src/app/entity/item-type.ts
  24. +16 −0 src/app/entity/item.ts
  25. +4 −0 src/app/entity/publisher.ts
  26. +4 −0 src/app/entity/team.ts
  27. +31 −35 src/app/environment.ts
  28. +3 −3 src/app/home/bangumi-detail/bangumi-detail.components.ts
  29. +4 −1 src/app/home/bangumi-list/bangumi-list.html
  30. +31 −0 src/app/home/bangumi-list/bangumi-list.less
  31. +8 −3 src/app/home/favorite-chooser/favorite-chooser.component.ts
  32. +12 −4 src/app/home/favorite-manager.service.ts
  33. +0 −1 src/app/home/my-bangumi/my-bangumi.component.ts
  34. +8 −8 src/app/home/play-episode/play-episode.component.ts
  35. +2 −2 src/app/home/play-episode/reveal-extra/reveal-extra.component.ts
  36. +0 −1 src/app/home/rating/edit-review-dialog/edit-review-dialog.component.ts
  37. +20 −15 src/app/home/user-action/user-action.component.ts
  38. +2 −2 src/app/home/user-center/user-center.component.ts
  39. +2 −2 src/app/home/web-hook/web-hook.component.ts
  40. +4 −0 src/app/video-player/controls/controls.component.ts
  41. +10 −3 src/app/video-player/core/shortcuts.ts
  42. +10 −0 src/app/video-player/float-controls/float-controls.component.ts
  43. +8 −6 src/app/video-player/video-player.service.ts
  44. +572 −488 yarn.lock
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
# pull_request:
# branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
to_gitlab:
runs-on: ubuntu-18.04
steps: # <-- must use actions/checkout@v1 before mirroring!
- uses: actions/checkout@v1
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
git@gitlab.com:iroha/Deneb.git
ssh_private_key: # <-- use 'secrets' to pass credential information.
${{ secrets.GITLAB_SSH_PRIVATE_KEY }}
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
image: "node:alpine"
build_and_deploy:
only:
refs:
- master
artifacts:
paths:
- dist/
expire_in: 1 day
script:
- yarn install
- npm run build:aot:prod
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
# Changelog

## 4.1.2

Add a placeholder for search result of bangumi list when no result is found.

## 4.1.1

fix bug #179 The episode watch status (color bar) doesn't change to lime color when this episode is finished. The sychronize also doesn't work for this.

## 4.1.0

### New Feature

Add support for Universal Source, this feature require Albireo version >= 3.0.0.

### bugfix

- Fix a bug that user-action component always report extension not enabled.
- Fix a bug(#177) that cause episode watch_progress cannot be synchronized with Sadr extension when episode finish playing.
- Fix a bug(#166) that cause Admin/Bangumi List to freeze when trying to type in search box while the bangumi is still loading.


## 4.0.7

- fix bug that angular doesn't run in production mode.

## 4.0.6

- fix a bug in PlayEpisode, when the video_id exists on the route parameter. the currentVideoFile may be null. which
cause the onLoadAndPlay get a null VideoFile.

## 4.0.5

fix a bug in favorite-manager.service, result user cannot change favorite when without using browser extension.

## 4.0.4

fix bug in admin/search-bangumi

## 4.0.3

fix double-clicking float player resulted bug.

## 4.0.2

- Add .gitlab-ci.yml in order to utilize gitlab pipelines
- Add a GLOBAL to fix `ngI18nClosureMode` is not defined issue.

## 4.0.1

Fix Reference error: ngI18nClosureMode is not defined by updating Angular to 8.2.10

## 4.0.0

### Refactor building scripts in order to upgrade to Angular 8.1.2
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Web App client for [Albireo](https://github.com/lordfriend/Albireo)

**This project is discontinued, I will suggest you upgrade to https://github.com/irohalab/mira-ui which has an upgrade angular version support**

## Building requirements

Nodejs 12.0 and above, npm 3 and above, Yarn (I recommend this package manager to manage npm packages)
@@ -70,4 +72,4 @@ We assume the image service support the following method:

To support this feature, we use [Picfit](https://github.com/thoas/picfit) and some nginx configuration.

But this is not a part of this project, you need to setup your own image service.
But this is not a part of this project, you need to setup your own image service.
1 change: 1 addition & 0 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@ module.exports = function (metadata) {
new DefinePlugin({
'ENV': JSON.stringify(metadata.ENV),
'ngDevMode': false,
'ngI18nClosureMode': false,
'HMR': metadata.HMR,
'SITE_TITLE': JSON.stringify(metadata.title),
'process.env': {
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Deneb",
"version": "4.0.0",
"version": "4.1.2",
"description": "Web client for Albireo",
"author": "Nyasoft<about@nya.io>",
"homepage": "https://github.com/lordfriend/Deneb",
@@ -37,23 +37,23 @@
"postinstall": "node scripts/font-fix.js"
},
"dependencies": {
"@angular/animations": "~8.2.5",
"@angular/common": "~8.2.5",
"@angular/compiler": "~8.2.5",
"@angular/compiler-cli": "~8.2.5",
"@angular/core": "~8.2.5",
"@angular/forms": "~8.2.5",
"@angular/platform-browser": "~8.2.5",
"@angular/platform-browser-dynamic": "~8.2.5",
"@angular/platform-server": "~8.2.5",
"@angular/router": "~8.2.5",
"@angular/animations": "~8.2.10",
"@angular/common": "~8.2.10",
"@angular/compiler": "~8.2.10",
"@angular/compiler-cli": "~8.2.10",
"@angular/core": "~8.2.10",
"@angular/forms": "~8.2.10",
"@angular/platform-browser": "~8.2.10",
"@angular/platform-browser-dynamic": "~8.2.10",
"@angular/platform-server": "~8.2.10",
"@angular/router": "~8.2.10",
"core-js": "~2.6",
"deneb-ui": "^1.0.0",
"downloadjs": "^1.4.7",
"hammerjs": "^2.0.8",
"ie-shim": "0.1.0",
"intersection-observer": "^0.5.0",
"moment": "^2.19.3",
"moment": "^2.29.4",
"ng2-date-picker": "^2.6.2",
"popper.js": "^1.12.9",
"reflect-metadata": "^0.1.9",
@@ -64,8 +64,8 @@
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-optimizer": "^0.801.2",
"@ngtools/webpack": "~8.3.3",
"@angular-devkit/build-optimizer": "^0.803.9",
"@ngtools/webpack": "~8.3.9",
"@types/chrome": "^0.0.58",
"@types/downloadjs": "^1.4.0",
"@types/hammerjs": "^2.0.33",
@@ -121,12 +121,13 @@
"url": "https://github.com/lordfriend/Deneb/issues"
},
"engines": {
"node": ">= 4.2.1",
"node": ">= 10",
"npm": ">= 3"
},
"sideEffects": [
"./src/polyfills.browser.ts",
"./src/main.browser.ts",
"./src/app/environment.ts",
"./src/assets/semantic-ui.ts",
"./node_modules/semantic-ui-less/semantic.less",
"./src/app/app.less",
13 changes: 8 additions & 5 deletions src/app/admin/admin.module.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import { HttpClientModule } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Admin } from './admin.component';
import { UniversalBuilderComponent } from './bangumi-detail/universal-builder/universal-builder.component';
import { SearchBangumi } from './search-bangumi';
import { ListBangumi } from './list-bangumi/list-bangumi.component';
import { BangumiDetail } from './bangumi-detail';
@@ -11,7 +12,7 @@ import { AdminService } from './admin.service';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { adminRoutes } from './admin.routes';
import { FeedService } from './bangumi-detail/keyword-builder/feed.service';
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 'deneb-ui';
@@ -22,7 +23,7 @@ import { BangumiStatusNamePipe, VideoFileStatusNamePipe } from './bangumi-pipes/
import { LibykPipe } from './bangumi-pipes/libyk-pipe';
import { BangumiMoeBuilder } from './bangumi-detail/bangumi-moe-builder/bangumi-moe-builder.component';
import { BangumiMoeService } from './bangumi-detail/bangumi-moe-builder/bangumi-moe.service';
import { BangumiMoePipe } from './bangumi-pipes/bangumi-moe-pipe';
import { ParseJsonPipe } from './bangumi-pipes/parse-json.pipe';
import { ConfirmDialogModule } from '../confirm-dialog';
import { TaskManager } from './task-manager/task-manager.component';
import { UserManager } from './user-manager/user-manager.component';
@@ -61,7 +62,7 @@ import { EditBangumiRecommendComponent } from './announce/edit-bangumi-recommend
BangumiStatusNamePipe,
LibykPipe,
NyaaPipe,
BangumiMoePipe,
ParseJsonPipe,
BangumiBasic,
BangumiMoeBuilder,
VideoFileStatusNamePipe,
@@ -74,7 +75,8 @@ import { EditBangumiRecommendComponent } from './announce/edit-bangumi-recommend
WebHookComponent,
WebHookCardComponent,
EditWebHookComponent,
EditBangumiRecommendComponent
EditBangumiRecommendComponent,
UniversalBuilderComponent
],
providers: [
AdminService,
@@ -109,7 +111,8 @@ import { EditBangumiRecommendComponent } from './announce/edit-bangumi-recommend
VideoFileModal,
EditAnnounceComponent,
EditWebHookComponent,
EditBangumiRecommendComponent
EditBangumiRecommendComponent,
UniversalBuilderComponent
]
})
export class AdminModule {
3 changes: 2 additions & 1 deletion src/app/admin/admin.service.ts
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@ export class AdminService extends BaseService {

queryBangumi(bgmId: number): Observable<BangumiRaw> {
let queryUrl = this.baseUrl + '/query/' + bgmId;
return this.http.get<BangumiRaw>(queryUrl).pipe(
return this.http.get<any>(queryUrl).pipe(
map<any, BangumiRaw>(res => new BangumiRaw(res)),
catchError(this.handleError));
}

63 changes: 53 additions & 10 deletions src/app/admin/bangumi-detail/bangumi-detail.component.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,9 @@ import { UserManagerSerivce } from '../user-manager/user-manager.service';
import { BangumiBasic } from './bangumi-basic/bangumi-basic.component';
import { BangumiMoeBuilder } from './bangumi-moe-builder/bangumi-moe-builder.component';
import { EpisodeDetail } from './episode-detail/episode-detail.component';
import { FeedService } from './feed.service';
import { KeywordBuilder } from './keyword-builder/keyword-builder.component';
import { UniversalBuilderComponent } from './universal-builder/universal-builder.component';
import { VideoFileModal } from './video-file-modal/video-file-modal.component';

export enum AnnounceStatus {
@@ -68,11 +70,15 @@ export class BangumiDetail implements OnInit, OnDestroy {

AnnounceStatus = AnnounceStatus;

modeList: string[];
availableModeCount: number;

constructor(private _route: ActivatedRoute,
private _router: Router,
private _adminService: AdminService,
private _userManagerService: UserManagerSerivce,
private _announceService: AnnounceService,
private _feedService: FeedService,
private _uiDialog: UIDialog,
titleService: Title,
toastService: UIToast
@@ -102,13 +108,23 @@ export class BangumiDetail implements OnInit, OnDestroy {
.subscribe(
(bangumi: Bangumi) => {
this.bangumi = bangumi;
this.updateAvailableModeCount();
this.fetchAnnounceList(bangumi.id);
},
(error: BaseError) => {
this._toastRef.show(error.message);
}
)
);
this._subscription.add(
this._feedService.getUniversalMeta()
.subscribe((metaList) => {
this.modeList = metaList;
this.updateAvailableModeCount();
}, (error) => {
this._toastRef.show(error.message);
})
);
}

ngOnDestroy(): void {
@@ -200,6 +216,30 @@ export class BangumiDetail implements OnInit, OnDestroy {
);
}

editBangumiUniversal(mode?: string) {
let dialogRef = this._uiDialog.open(UniversalBuilderComponent, {stickyDialog: true, backdrop: true});
dialogRef.componentInstance.bangumi = this.bangumi;
dialogRef.componentInstance.modeList = this.modeList;
dialogRef.componentInstance.mode = mode;
this._subscription.add(
dialogRef.afterClosed().pipe(
filter((result: any) => !!result),
mergeMap((result: any) => {
this.isLoading = true;
this.bangumi.universal = JSON.stringify(result.result);
return this._adminService.updateBangumi(this.bangumi);
}),)
.subscribe(() => {
this.isLoading = false;
this._toastRef.show('更新成功');
this.updateAvailableModeCount();
}, (error) => {
this.isLoading = false;
this._toastRef.show(error.message);
})
);
}

editEpisode(episode?: Episode) {
let dialogRef = this._uiDialog.open(EpisodeDetail, {stickyDialog: true, backdrop: true});
dialogRef.componentInstance.episode = episode;
@@ -309,14 +349,17 @@ export class BangumiDetail implements OnInit, OnDestroy {
);
}

// getVideoFiles(episode: Episode) {
// this._subscription.add(
// this._adminService.getEpisodeVideoFiles(episode.id)
// .subscribe(
// (videoFiles => {
// episode.video_files = videoFiles;
// })
// )
// );
// }
private updateAvailableModeCount() {
if (!this.modeList) {
return;
}
if (!this.bangumi.universal) {
this.availableModeCount = this.modeList.length;
} else {
let universalList = JSON.parse(this.bangumi.universal);
this.availableModeCount = this.modeList.filter(m => {
return !universalList.some(u => u.mode === m);
}).length;
}
}
}
21 changes: 20 additions & 1 deletion src/app/admin/bangumi-detail/bangumi-detail.html
Original file line number Diff line number Diff line change
@@ -82,12 +82,31 @@ <h4 class="entry">
</div>
<a class="edit-button anchor-button" (click)="editBasicInfo()"><i class="edit icon"></i></a>
</div>
<div class="download-info">
<h4 class="section-header">抓取来源(Universal)</h4>
<div class="universal-entry entry" *ngFor="let universal of bangumi.universal | parseJson">
<div class="entry-key">{{universal.mode}}</div>
<div class="entry-value">
<div class="ui horizontal label">
{{universal.keyword}}
</div>
<a class="edit-button anchor-button" (click)="editBangumiUniversal(universal.mode)"><i class="edit icon"></i></a>
</div>
</div>
<a class="anchor-button add-universal-button"
*ngIf="availableModeCount > 0"
(click)="editBangumiUniversal()"><i class="plus icon"></i>添加来源</a>
<div class="ui inverted dimmer" [ngClass]="{active: !modeList}">
<div class="ui large loader"></div>
</div>
</div>
<div class="download-info">
<h4 class="section-header">抓取来源</h4>
<div class="ui warning message">DMHY, ACG.RIP, NYAA在未来的版本将会默认被禁用,请使用Universal</div>
<div class="bangumi-moe-entry entry">
<div class="entry-key">BANGUMI.MOE</div>
<div class="entry-value">
<div class="ui horizontal label" *ngFor="let tag of bangumi.bangumi_moe | bangumiMoe">
<div class="ui horizontal label" *ngFor="let tag of bangumi.bangumi_moe | parseJson">
{{tag.locale.zh_cn || tag.name}}
</div>
<a class="edit-button anchor-button" (click)="editBangumiMoe()"><i class="edit icon"></i></a>
Loading