Skip to content
This repository was archived by the owner on Oct 27, 2024. It is now read-only.

Commit 72f4619

Browse files
committed
Moved Youtube URLs to Api
1 parent 4399c4b commit 72f4619

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/src/main/java/com/esoxjem/movieguide/Api.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ public class Api
1212
public static final String GET_REVIEWS = "http://api.themoviedb.org/3/movie/%s/reviews?api_key=" + API_KEY;
1313
public static final String POSTER_PATH = "http://image.tmdb.org/t/p/w342";
1414
public static final String BACKDROP_PATH = "http://image.tmdb.org/t/p/w780";
15+
public static final String YOUTUBE_VIDEO_URL = "http://www.youtube.com/watch?v=%1$s";
16+
public static final String YOUTUBE_THUMBNAIL_URL = "http://img.youtube.com/vi/%1$s/0.jpg";
1517
}

app/src/main/java/com/esoxjem/movieguide/Video.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static String getUrl(Video video)
5151
{
5252
if (SITE_YOUTUBE.equalsIgnoreCase(video.getSite()))
5353
{
54-
return String.format("http://www.youtube.com/watch?v=%1$s", video.getVideoId());
54+
return String.format(Api.YOUTUBE_VIDEO_URL, video.getVideoId());
5555
} else
5656
{
5757
return Constants.EMPTY;
@@ -62,7 +62,7 @@ public static String getThumbnailUrl(Video video)
6262
{
6363
if (SITE_YOUTUBE.equalsIgnoreCase(video.getSite()))
6464
{
65-
return String.format("http://img.youtube.com/vi/%1$s/0.jpg", video.getVideoId());
65+
return String.format(Api.YOUTUBE_THUMBNAIL_URL, video.getVideoId());
6666
} else
6767
{
6868
return Constants.EMPTY;

0 commit comments

Comments
 (0)