open api changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// Generated using typescript-generator version 4.1.1 on 2026-07-24 16:46:55.
|
||||
// Generated using typescript-generator version 4.1.1 on 2026-07-26 14:02:29.
|
||||
|
||||
export interface Session {
|
||||
sessionId: string;
|
||||
|
||||
@@ -35,7 +35,7 @@ export class YoutubeSearchResult implements OnChanges {
|
||||
this._album = this.musicRecord.album?.name || 'Album Name';
|
||||
this._duration = this.musicRecord.duration || '0:00';
|
||||
this._views = this.musicRecord.views || '0 views';
|
||||
this._thumbnailUrl = this.musicRecord.thumbnails?.[1]?.url || this._thumbnailUrl;
|
||||
this._thumbnailUrl = this.musicRecord.thumbnails?.[0]?.url || this._thumbnailUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
<mat-label>Search</mat-label>
|
||||
<input matInput [(ngModel)]="searchQuery" placeholder="Enter search query">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="filter-field">
|
||||
<mat-label>Filter</mat-label>
|
||||
<mat-select [(ngModel)]="searchFilter">
|
||||
<mat-option *ngFor="let f of filters" [value]="f">{{f}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<button mat-raised-button color="primary" (click)="performSearch()">Search</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,23 +11,47 @@ import { YoutubeSearchResult } from '../youtube-search-result/youtube-search-res
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-youtube-search-tab',
|
||||
imports: [YoutubeSearchResult, CommonModule, MatFormFieldModule, MatInputModule, MatButtonModule, FormsModule],
|
||||
imports: [
|
||||
YoutubeSearchResult,
|
||||
CommonModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatSelectModule,
|
||||
MatButtonModule,
|
||||
FormsModule,
|
||||
],
|
||||
templateUrl: './youtube-search-tab.html',
|
||||
styleUrl: './youtube-search-tab.css'
|
||||
styleUrl: './youtube-search-tab.css',
|
||||
})
|
||||
export class YoutubeSearchTab {
|
||||
private readonly youtubeService = inject(YoutubeControllerService);
|
||||
searchResults: WritableSignal<MusicRecord[]> = signal([]);
|
||||
searchQuery: string = '';
|
||||
searchFilter: QueryDto['filter'] = 'SONGS';
|
||||
filters: QueryDto['filter'][] = [
|
||||
'SONGS',
|
||||
'VIDEOS',
|
||||
'ALBUMS',
|
||||
'ARTISTS',
|
||||
'PLAYLISTS',
|
||||
'COMMUNITY_PLAYLISTS',
|
||||
'FEATURED_PLALISTS',
|
||||
'PROFILES',
|
||||
'PODCASTS',
|
||||
'EPISODES',
|
||||
'NONE',
|
||||
];
|
||||
|
||||
performSearch(): void {
|
||||
const queryDto: QueryDto = {
|
||||
queryString: this.searchQuery,
|
||||
filter: this.searchFilter,
|
||||
};
|
||||
|
||||
this.youtubeService.query(queryDto).subscribe({
|
||||
@@ -40,8 +64,5 @@ export class YoutubeSearchTab {
|
||||
console.error('Query error:', error);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user