-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from chytanka/develop
Develop
- Loading branch information
Showing
17 changed files
with
170 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LinkParser } from "./link-parser"; | ||
|
||
export class YandereParser extends LinkParser { | ||
override regex = /yande\.re\/pool\/show\/(\d+)/; | ||
override site = 'yandere'; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { inject, Injectable } from '@angular/core'; | ||
import { environment } from '../../../environments/environment'; | ||
import { HttpClient } from '@angular/common/http'; | ||
import { Observable, map } from 'rxjs'; | ||
import { CompositionEpisode, CompositionPublisher } from '../../common/common-read'; | ||
import { Base64 } from '../../shared/utils'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class YandereService { | ||
http: HttpClient = inject(HttpClient) | ||
|
||
getComposition(id: string): Observable<CompositionEpisode> { | ||
return this.http.get<any>(environment.yanderePoolsHost + id) | ||
.pipe(map((data) => { return this.map(data) })) | ||
} | ||
|
||
map(data: any): CompositionEpisode { | ||
const mappedResponse = { | ||
title: data.name, | ||
|
||
images: (data.posts.map((item: any) => { | ||
return { | ||
src: item.sample_url, | ||
width: item.sample_width, | ||
height: item.sample_height | ||
}; | ||
})).filter((i: any) => i.src) | ||
.map((img: any) => { | ||
return { | ||
src: environment.proxy + Base64.toBase64(img.src), | ||
width: img.width, | ||
height: img.height | ||
} | ||
}) | ||
|
||
}; | ||
|
||
return mappedResponse; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { YandereShellComponent } from './yandere-shell/yandere-shell.component'; | ||
|
||
const routes: Routes = [ | ||
{ path: '', redirectTo: '/', pathMatch: 'full' }, | ||
{ | ||
path: ':id', | ||
component: YandereShellComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class YandereRoutingModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<app-common-read [episode$]="episode$" [error$]="error$" [loading$]="loading$" (refreshData)="refreshData()" | ||
[playlist]="playlistService.playlist()" [playlistLink]="playlistLink()" [currentPlaylistItem]="currentPlItem()"> | ||
|
||
<p>{{lang.ph().imagesVia}}<a href="https://yande.re" target="_blank" rel="noopener noreferrer">Yande.re</a> | ||
API. | ||
{{lang.ph().thanks}}<br>{{lang.ph().detalisCopy}}</p> | ||
|
||
</app-common-read> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Component, inject, OnDestroy } from '@angular/core'; | ||
import { switchMap, of } from 'rxjs'; | ||
import { ReadBaseComponent } from '../../common/common-read'; | ||
import { Base64 } from '../../shared/utils'; | ||
import { YandereService } from '../data-access/yandere.service'; | ||
import { YANDERE_PATH } from '../../app-routing.module'; | ||
|
||
@Component({ | ||
selector: 'app-yandere-shell', | ||
templateUrl: './yandere-shell.component.html', | ||
styleUrl: './yandere-shell.component.scss' | ||
}) | ||
export class YandereShellComponent extends ReadBaseComponent implements OnDestroy { | ||
yandere = inject(YandereService) | ||
|
||
override episode$ = this.combineParamMapAndRefresh() | ||
.pipe(this.tapStartLoading(), | ||
switchMap(([params]) => { | ||
const pathParam = params?.get('id'); | ||
|
||
if (!pathParam) return of(null); | ||
|
||
const path = (Base64.isBase64(pathParam)) ? Base64.fromBase64(pathParam) : pathParam; | ||
|
||
return (this.yandere.getComposition(path)).pipe(this.catchError(), this.tapSetTitle(), | ||
this.tapSaveToHistory(YANDERE_PATH, path), | ||
this.tapSaveToCurrentPlaylistItem(YANDERE_PATH, path), | ||
this.finalizeLoading()); | ||
}) | ||
); | ||
|
||
constructor() { | ||
super() | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.plObserv?.unsubscribe(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { YandereRoutingModule } from './yandere-routing.module'; | ||
import { YandereShellComponent } from './yandere-shell/yandere-shell.component'; | ||
import { CommonReadModule } from '../common/common-read'; | ||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
YandereShellComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
YandereRoutingModule, | ||
CommonReadModule | ||
] | ||
}) | ||
export class YandereModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters