Skip to content

Commit 852be1d

Browse files
committed
2.0.1 - Adding interfaces for channel list and channel
1 parent 0f9c0a7 commit 852be1d

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

dist/main.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/components/youtube-search.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'rxjs/add/operator/map';
77

88
import { IFeedVideo } from '../models/feed-video.model';
99
import { ISearchVideo } from '../models/search-video.model';
10+
import { IChannelList } from '../models/channel.model';
1011

1112
@Component({
1213
selector: 'app-search',
@@ -20,7 +21,7 @@ export class SearchComponent implements OnInit {
2021

2122
videos: Array<ISearchVideo>;
2223
feedVideos: Array<IFeedVideo>;
23-
channel: any;
24+
channel: IChannelList;
2425

2526
_shared: any;
2627
_app: any;

src/app/models/channel.model.ts

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
export interface IChannelHint {
2+
property: string;
3+
value: string;
4+
}
5+
6+
export interface IChannelBrandImage {
7+
bannerImageUrl: string;
8+
bannerMobileExtraHdImageUrl: string;
9+
bannerMobileHdImageUrl: string;
10+
bannerMobileImageUrl: string;
11+
bannerMobileLowImageUrl: string;
12+
bannerMobileMediumHdImageUrl: string;
13+
bannerTabletExtraHdImageUrl: string;
14+
bannerTabletHdImageUrl: string;
15+
bannerTabletImageUrl: string;
16+
bannerTabletLowImageUrl: string;
17+
bannerTvHighImageUrl: string;
18+
bannerTvImageUrl: string;
19+
bannerTvLowImageUrl: string;
20+
bannerTvMediumImageUrl: string;
21+
}
22+
23+
export interface IChannelSnippet {
24+
customUrl: string;
25+
description: string;
26+
localized: {
27+
description: string;
28+
title: string;
29+
};
30+
publishedAt: string;
31+
thumbnails: {
32+
default: {
33+
url: string;
34+
};
35+
high: {
36+
url: string;
37+
};
38+
medium: {
39+
url: string;
40+
};
41+
};
42+
title: string;
43+
}
44+
45+
export interface IChannelStatistics {
46+
commentCount: string;
47+
hiddenSubscriberCount: boolean;
48+
subscriberCount: string;
49+
videoCount: string;
50+
viewCount: string;
51+
}
52+
53+
export interface IChannel {
54+
brandingSettings: {
55+
channel: {
56+
defaultTab: string;
57+
description: string;
58+
featuredChannelsTitle: string;
59+
featuredChannelsUrls: Array<string>;
60+
keywords: string;
61+
profileColor: string;
62+
showBrowseView: boolean;
63+
showrelatedChannels: boolean;
64+
title: string;
65+
trackingAnalyticsAccountId: string;
66+
unsubscribedTrailer: string;
67+
};
68+
hints: Array<IChannelHint>;
69+
image: IChannelBrandImage;
70+
};
71+
contentDetails: {
72+
relatedPlaylists: {
73+
uploads: string;
74+
watchHistory: string;
75+
watchLater: string;
76+
};
77+
};
78+
etag: string;
79+
id: string;
80+
kind: string;
81+
snippet: IChannelSnippet;
82+
statistics: IChannelStatistics;
83+
}
84+
85+
export interface IChannelList {
86+
etag: string;
87+
items: Array<IChannel>;
88+
kind: string;
89+
pageInfo: {
90+
totalResults: number;
91+
resultsPerPage: number;
92+
};
93+
}

src/app/shared/lists.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'rxjs/add/operator/map';
66

77
import { IFeedVideo } from '../models/feed-video.model';
88
import { ISearchVideo } from '../models/search-video.model';
9+
import { IChannelList } from '../models/channel.model';
910

1011
@Injectable()
1112
export class SharedService {
@@ -14,7 +15,7 @@ export class SharedService {
1415
public lastSearchedVideos: Array<ISearchVideo>;
1516
public historyVideos: Array<any> = [];
1617
public settings: Array<any>;
17-
public channel: Array<any>;
18+
public channel: IChannelList;
1819
public playlist: Array<any>;
1920

2021
_update: any;

0 commit comments

Comments
 (0)