Skip to content

Commit f4558f0

Browse files
committed
maxime_commit
1 parent c6f094f commit f4558f0

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

.idea/misc.xml

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

app/src/main/java/com/example/golfier/android_youtube_api/MakeRequestTask.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,19 +214,24 @@ public void setStatusErr (int nb) {
214214
*
215215
* @param iterator of Playlist Items from uploaded Playlist
216216
*/
217-
private static void prettyPrint(int size, Iterator<PlaylistItem> playlistEntries) {
217+
private void prettyPrint(int size, Iterator<PlaylistItem> playlistEntries) {
218218
System.out.println("=============================================================");
219219
System.out.println("\t\tTotal Videos Uploaded: " + size);
220220
System.out.println("=============================================================\n");
221221

222-
List<String> myVideoId = new A
222+
List<YoutubeVideo> myVideo = new ArrayList<>();
223223

224224
while (playlistEntries.hasNext()) {
225225
PlaylistItem playlistItem = playlistEntries.next();
226226
System.out.println(" video name = " + playlistItem.getSnippet().getTitle());
227227
System.out.println(" video id = " + playlistItem.getContentDetails().getVideoId());
228228
System.out.println(" upload date = " + playlistItem.getSnippet().getPublishedAt());
229229
System.out.println("\n-------------------------------------------------------------\n");
230+
YoutubeVideo vid = new YoutubeVideo(playlistItem.getSnippet().getTitle(),
231+
playlistItem.getContentDetails().getVideoId(),
232+
playlistItem.getSnippet().getPublishedAt().toString());
233+
myVideo.add(vid);
230234
}
235+
youtubeUser.addVideoContent(myVideo);
231236
}
232237
}

app/src/main/java/com/example/golfier/android_youtube_api/YoutubeUser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class YoutubeUser {
1111
private List<String> listId;
1212
private List<String> listTitle;
1313
private List<String> listChannelIdUpload;
14-
private List<String> listUpload;
14+
private List<YoutubeVideo> listUpload;
1515
private List<BigInteger> listViewCount;
1616

1717
public YoutubeUser() {
@@ -48,12 +48,12 @@ public List<BigInteger> getListViewCount() {
4848
return listViewCount;
4949
}
5050

51-
public List<String> getListUpload() {
51+
public List<YoutubeVideo> getListUpload() {
5252

5353
return listUpload;
5454
}
5555

56-
public void setListUpload(List<String> listUpload) {
56+
public void setListUpload(List<YoutubeVideo> listUpload) {
5757
this.listUpload = listUpload;
5858
}
5959

@@ -88,7 +88,7 @@ public void addInformation (String id, String title, BigInteger viewCount, Strin
8888
this.listViewCount.add(viewCount);
8989
}
9090

91-
public void addVideoContent(List<String> videoId) {
91+
public void addVideoContent(List<YoutubeVideo> videoId) {
9292
this.listUpload.addAll(videoId);
9393
}
9494
}

app/src/main/java/com/example/golfier/android_youtube_api/YoutubeVideo.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package com.example.golfier.android_youtube_api;
22

3+
import com.google.api.client.util.DateTime;
4+
35
public class YoutubeVideo {
46
private String videoId;
5-
private String dateUpload;
67
private String title;
8+
private String dateUpload;
79

8-
YoutubeVideo(String id, String upload, String title){
10+
YoutubeVideo(String title, String id, String upload){
911
this.videoId = id;
1012
this.dateUpload = upload;
1113
this.title = title;

0 commit comments

Comments
 (0)