clean up and lint files

This commit is contained in:
2025-01-05 10:29:29 +01:00
parent 54ee9a5b11
commit 189478f078
137 changed files with 1096 additions and 1340 deletions

View File

@@ -8,8 +8,7 @@ import {DbService} from '../../../services/db.service';
providedIn: 'root',
})
export class FileDataService {
public constructor(private db: DbService) {
}
public constructor(private db: DbService) {}
public async set(songId: string, file: FileServer): Promise<string> {
const songRef = this.db.doc('songs/' + songId);

View File

@@ -7,8 +7,10 @@ import {FileDataService} from './file-data.service';
providedIn: 'root',
})
export class FileService {
public constructor(private storage: AngularFireStorage, private fileDataService: FileDataService) {
}
public constructor(
private storage: AngularFireStorage,
private fileDataService: FileDataService
) {}
public getDownloadUrl(path: string): Observable<string> {
const ref = this.storage.ref(path);

View File

@@ -19,7 +19,7 @@ describe('SongDataService', () => {
() =>
void TestBed.configureTestingModule({
providers: [{provide: AngularFirestore, useValue: mockAngularFirestore}],
}),
})
);
it('should be created', () => {
@@ -27,13 +27,10 @@ describe('SongDataService', () => {
void expect(service).toBeTruthy();
});
it(
'should list songs',
waitForAsync(() => {
const service: SongDataService = TestBed.inject(SongDataService);
service.list$().subscribe(s => {
void expect(s[0].title).toEqual('title1');
});
}),
);
it('should list songs', waitForAsync(() => {
const service: SongDataService = TestBed.inject(SongDataService);
service.list$().subscribe(s => {
void expect(s[0].title).toEqual('title1');
});
}));
});

View File

@@ -14,6 +14,7 @@ export class SongDataService {
public constructor(private dbService: DbService) {
this.dbService.col$<Song>(this.collection).subscribe(_ => this.list$.next(_));
}
// public list$ = (): Observable<Song[]> => this.dbService.col$(this.collection);
//public read$ = (songId: string): Observable<Song | null> => this.dbService.doc$(this.collection + '/' + songId);

View File

@@ -9,8 +9,7 @@ import {filter} from 'rxjs/operators';
providedIn: 'root',
})
export class SongListResolver {
public constructor(private songService: SongService) {
}
public constructor(private songService: SongService) {}
public resolve(): Observable<Song[]> {
return this.songService.list$().pipe(filter(_ => _.length > 0));

View File

@@ -15,7 +15,7 @@ describe('SongService', () => {
() =>
void TestBed.configureTestingModule({
providers: [{provide: SongDataService, useValue: mockSongDataService}],
}),
})
);
it('should be created', () => {
@@ -23,13 +23,10 @@ describe('SongService', () => {
void expect(service).toBeTruthy();
});
it(
'should list songs',
waitForAsync(() => {
const service: SongService = TestBed.inject(SongService);
service.list$().subscribe(s => {
void expect(s[0].title).toEqual('title1');
});
}),
);
it('should list songs', waitForAsync(() => {
const service: SongService = TestBed.inject(SongService);
service.list$().subscribe(s => {
void expect(s[0].title).toEqual('title1');
});
}));
});

View File

@@ -27,7 +27,7 @@ export class SongService {
public constructor(
private songDataService: SongDataService,
private userService: UserService,
private userService: UserService
) {
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
}

View File

@@ -10,7 +10,10 @@ import {FileServer} from './fileServer';
providedIn: 'root',
})
export class UploadService extends FileBase {
public constructor(private fileDataService: FileDataService, private angularFireStorage: AngularFireStorage) {
public constructor(
private fileDataService: FileDataService,
private angularFireStorage: AngularFireStorage
) {
super();
}