Skip to content

Commit 5e82c16

Browse files
committed
chore(server): added extra debug prints and renamed show service
1 parent 00372e7 commit 5e82c16

File tree

10 files changed

+26
-9
lines changed

10 files changed

+26
-9
lines changed

server/src/api/routes/batch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { getFromContainer } from '@/infrastructure/container/container';
88
import { MovieMapper } from '@/resources/movie/mapper';
99
import { ShowMapper } from '@/resources/show/mapper';
1010
import { MovieService } from '@/services/movie/movie';
11-
import { ShowService } from '@/services/show/show';
11+
import { ShowService } from '@/services/show/show-service';
1212

1313
const handleTv = async (ctx: Context) => {
1414
const service = getFromContainer(ShowService);

server/src/api/routes/show.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Context } from 'koa';
44

55
import { getFromContainer } from '@/infrastructure/container/container';
66
import { ShowMapper } from '@/resources/show/mapper';
7-
import { ShowService } from '@/services/show/show';
7+
import { ShowService } from '@/services/show/show-service';
88
import { discoverSeries, network } from '@/services/tmdb/show';
99

1010
const lookupById = async (ctx: Context) => {

server/src/services/cache/cache-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { CompanyService } from '@/services/company/company-service';
1616
import { MovieService } from '@/services/movie/movie';
1717
import { NetworkService } from '@/services/network/network-service';
1818
import { PersonService } from '@/services/person/person-service';
19-
import { ShowService } from '@/services/show/show';
19+
import { ShowService } from '@/services/show/show-service';
2020

2121
@Service()
2222
export class CacheService {

server/src/services/company/company-service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ export class CompanyService {
3838
.map((result) => result.unwrap());
3939
},
4040
);
41-
return companies.map((company) => CompanyEntity.create(company));
41+
return companies.map((company) => {
42+
this.logger.debug(
43+
{ companyId: company.provider.tmdbId },
44+
`got company details`,
45+
);
46+
return CompanyEntity.create(company);
47+
});
4248
} catch (error) {
4349
this.logger.error({ error }, 'Error fetching companies');
4450
return [];

server/src/services/movie/movie.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class MovieService {
7878
const details = detailsResult.unwrap();
7979
const ratings = ratingProvider?.isOk() ? ratingProvider.unwrap() : {};
8080
const artwork = artworkResult?.isOk() ? artworkResult.unwrap() : {};
81-
this.logger.debug(`got movie details for ${id}`);
81+
this.logger.debug({ movieId: id }, `got movie details`);
8282
return {
8383
...details,
8484
artwork: {

server/src/services/network/network-service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ export class NetworkService {
3939
.map((result) => result.unwrap());
4040
},
4141
);
42-
return networks.map((network) => NetworkEntity.create(network));
42+
return networks.map((network) => {
43+
this.logger.debug(
44+
{ networkId: network.provider.tmdbId },
45+
`got network details`,
46+
);
47+
return NetworkEntity.create(network);
48+
});
4349
} catch (error) {
4450
this.logger.error({ error }, 'Error fetching networks');
4551
return [];

server/src/services/person/person-service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
PersonTrendingProvider,
1313
} from '@/services/person/provider/provider';
1414
import { GetDetailsOptions } from '@/services/person/types';
15-
import { ShowService } from '@/services/show/show';
15+
import { ShowService } from '@/services/show/show-service';
1616

1717
@Service()
1818
export class PersonService {
@@ -67,6 +67,7 @@ export class PersonService {
6767
),
6868
]);
6969
}
70+
this.logger.debug({ personId: id }, `got person details`);
7071
return Some(person);
7172
} catch (error) {
7273
this.logger.error({ error }, 'Error fetching person details');

server/src/services/scanner/scanner-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ShowRepository } from '@/resources/show/repository';
1515
import { MovieService } from '@/services/movie/movie';
1616
import { ScannerProvider } from '@/services/scanner/provider';
1717
import { scannerProviders } from '@/services/scanner/providers';
18-
import { ShowService } from '@/services/show/show';
18+
import { ShowService } from '@/services/show/show-service';
1919
import { UserService } from '@/services/user/user';
2020

2121
@Service()

server/src/services/show/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
ShowTrendingProvider,
88
} from '@/services/show/provider/provider';
99
import { TmdbShowProvider } from '@/services/show/provider/tmdb/tmdb';
10-
import { ShowService } from '@/services/show/show';
10+
import { ShowService } from '@/services/show/show-service';
1111

1212
export default (builder: ContainerBuilder) => {
1313
builder.register(ShowProvider).use(TmdbShowProvider).asSingleton();

server/src/services/show/show.ts renamed to server/src/services/show/show-service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ export class ShowService {
7777
const artwork = artworkResult?.isOk()
7878
? artworkResult.unwrap()
7979
: undefined;
80+
this.logger.debug(
81+
{ showId: id, seasons: details.seasons.length },
82+
`got show details`,
83+
);
8084
return {
8185
...details,
8286
artwork: {

0 commit comments

Comments
 (0)