Skip to content

Commit cac0264

Browse files
committed
Merge remote-tracking branch 'my/development' into development
2 parents 38def08 + f50b7c3 commit cac0264

File tree

245 files changed

+5887
-2318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

245 files changed

+5887
-2318
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "base/submodules/TorrentStreamServer-Android"]
2+
path = base/submodules/TorrentStreamServer-Android
3+
url = [email protected]:julyworlds/TorrentStreamServer-Android.git

base/build.gradle

+9-7
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ android {
99
def gitBranch = (System.getenv('GIT_BRANCH') == null ? 'local' : System.getenv('GIT_BRANCH').replace('origin/', ''))
1010
def releaseType = (System.getenv('RELEASE_TYPE') == null ? 'NONE' : System.getenv('RELEASE_TYPE'))
1111
def updateUrls = (System.getenv('UPDATE_URLS') == null ? '"https://popcorntime.sh/android-update.json"' : System.getenv('UPDATE_URLS'))
12-
def animeUrls = (System.getenv('ANIME_URLS') == null ? '"https://anime.api-fetch.sh/"' : System.getenv('ANIME_URLS'))
13-
def movieUrls = (System.getenv('MOVIE_URLS') == null ? '"https://movies-v2.api-fetch.sh/"' : System.getenv('MOVIE_URLS'))
14-
def tvUrls = (System.getenv('TV_URLS') == null ? '"https://tv-v2.api-fetch.sh/"' : System.getenv('TV_URLS'))
12+
def animeUrls = (System.getenv('ANIME_URLS') == null ? '"https://popcorn-time.ga/"' : System.getenv('ANIME_URLS'))
13+
def movieUrls = (System.getenv('MOVIE_URLS') == null ? '"https://popcorn-time.ga/"' : System.getenv('MOVIE_URLS'))
14+
def tvUrls = (System.getenv('TV_URLS') == null ? '"https://popcorn-time.ga/"' : System.getenv('TV_URLS'))
1515

1616
defaultConfig {
1717
minSdkVersion rootProject.ext.minSdk
@@ -25,6 +25,7 @@ android {
2525
buildConfigField 'String[]', 'TV_URLS', '{' + tvUrls + '}'
2626
versionCode buildNumber
2727
multiDexEnabled true
28+
resValue 'string', 'sentry_dsn', rootProject.ext.sentryDsn
2829
}
2930

3031
buildTypes {
@@ -61,7 +62,7 @@ dependencies {
6162

6263
api 'androidx.legacy:legacy-support-v4:1.0.0'
6364
api 'androidx.palette:palette:1.0.0'
64-
api 'com.google.android.material:material:1.1.0'
65+
api 'com.google.android.material:material:1.3.0'
6566

6667
debugApi 'com.squareup.leakcanary:leakcanary-android:1.5'
6768
releaseApi 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
@@ -71,8 +72,6 @@ dependencies {
7172
api "com.squareup.picasso:picasso:${rootProject.ext.picassoVersion}"
7273
api "com.jakewharton:butterknife:${rootProject.ext.butterknifeVersion}"
7374

74-
api "com.github.TorrentStream:TorrentStreamServer-Android:${rootProject.ext.torrentstreamServerVersion}"
75-
7675
api 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
7776

7877
api 'com.koushikdutta.async:androidasync:2.1.9'
@@ -88,7 +87,10 @@ dependencies {
8887
annotationProcessor "com.google.dagger:dagger-compiler:${rootProject.ext.daggerVersion}"
8988
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.ext.butterknifeVersion}"
9089

91-
compileOnly "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"
90+
implementation "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"
91+
annotationProcessor "javax.annotation:javax.annotation-api:${rootProject.ext.javaxAnnotationVersion}"
9292

93+
implementation 'io.sentry:sentry-android:4.3.0'
9394

95+
api project(":StreamServerTorrent")
9496
}

base/proguard-rules.pro

+11
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,20 @@
1616
# public *;
1717
#}
1818

19+
-keep class com.connectsdk.** { * ; }
1920
-keep class org.eclipse.mat.** { *; }
2021
-keep class com.squareup.leakcanary.** { *; }
2122

23+
-keepclasseswithmembernames,includedescriptorclasses class org.libtorrent4j.swig.libtorrent_jni {
24+
native <methods>;
25+
}
26+
-keep class org.libtorrent4j.swig.** { *; }
27+
28+
-keep class com.github.se_bastiaan.torrentstreamserver.** { *; }
29+
-keep class com.github.se_bastiaan.torrentstream.** { *; }
30+
31+
-keep class libcore.io.** { *; }
32+
2233
-keep class butterknife.** { *; }
2334
-dontwarn butterknife.internal.**
2435
-keep class **$$ViewBinder { *; }

base/settings.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include ":StreamServerTorrent"
2+
project(":StreamServerTorrent").projectDir = file("./submodules/TorrentStreamServer-Android/library")

base/src/main/AndroidManifest.xml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
android:resource="@xml/provider_paths" />
2222
</provider>
2323

24+
<meta-data android:name="io.sentry.dsn" android:value="@string/sentry_dsn" />
25+
<uses-library android:name="org.apache.http.legacy" android:required="false" />
2426
</application>
2527

2628
</manifest>

base/src/main/java/butter/droid/base/ButterApplication.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void onCreate() {
127127
}
128128
}
129129

130-
Timber.d("StorageLocations: " + StorageUtils.getAllStorageLocations());
130+
Timber.d("StorageLocations: " + StorageUtils.getAllStorageLocations(this));
131131
Timber.i("Chosen cache location: " + directory);
132132

133133
Picasso.setSingletonInstance(picasso);

base/src/main/java/butter/droid/base/beaming/BeamManager.java

+17-4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import com.connectsdk.core.ImageInfo;
2929
import com.connectsdk.core.MediaInfo;
30+
import com.connectsdk.core.SubtitleInfo;
3031
import com.connectsdk.device.ConnectableDevice;
3132
import com.connectsdk.device.ConnectableDeviceListener;
3233
import com.connectsdk.discovery.CapabilityFilter;
@@ -245,9 +246,9 @@ public void playVideo(StreamInfo info, final MediaPlayer.LaunchListener listener
245246
TorrentStreamServer.getInstance().setStreamSrtSubtitle(srtFile);
246247
TorrentStreamServer.getInstance().setStreamVttSubtitle(vttFile);
247248

248-
if(mCurrentDevice.hasCapability(MediaPlayer.Subtitles_Vtt)) {
249+
if(mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
249250
subsLocation = location.substring(0, location.lastIndexOf('.')) + ".vtt";
250-
} else if (mCurrentDevice.hasCapability(MediaPlayer.Subtitles_Srt)) {
251+
} else if (mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
251252
subsLocation = location.substring(0, location.lastIndexOf('.')) + ".srt";
252253
}
253254
} else {
@@ -274,8 +275,20 @@ public void playVideo(StreamInfo info, final MediaPlayer.LaunchListener listener
274275

275276
//String url, String mimeType, String title, String description, String iconSrc, boolean shouldLoop, LaunchListener listener
276277
if (mCurrentDevice != null) {
277-
MediaInfo mediaInfo = new MediaInfo(location, subsLocation, "video/mp4", title, "");
278-
mediaInfo.addImages(new ImageInfo(imageUrl));
278+
MediaInfo.Builder builder = new MediaInfo.Builder(location, "video/mp4");
279+
builder.setTitle(title);
280+
builder.setIcon(new ImageInfo(imageUrl));
281+
if (subsLocation != null) {
282+
SubtitleInfo.Builder sBuilder = new SubtitleInfo.Builder(subsLocation);
283+
sBuilder.setLanguage(info.getSubtitleLanguage());
284+
if(mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
285+
sBuilder.setMimeType(MediaPlayer.Subtitle_WebVTT);
286+
} else if (mCurrentDevice.hasCapability(MediaPlayer.Subtitle_WebVTT)) {
287+
sBuilder.setMimeType(MediaPlayer.Subtitle_SRT);
288+
}
289+
builder.setSubtitleInfo(sBuilder.build());
290+
}
291+
MediaInfo mediaInfo = builder.build();
279292
mCurrentDevice.getCapability(MediaPlayer.class).playMedia(mediaInfo, false, new MediaPlayer.LaunchListener() {
280293
@Override
281294
public void onSuccess(MediaPlayer.MediaLaunchObject object) {

base/src/main/java/butter/droid/base/content/preferences/DefaultPlayer.java

+2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ public static boolean start(Media media, String subLanguage, String location) {
112112
if (media != null) {
113113
if (media.isMovie) {
114114
intent.putExtra("title", media.title);
115+
intent.putExtra("filename", media.title);
115116
} else {
116117
Episode episode = (Episode) media;
117118
intent.putExtra("title", String.format(LocaleUtils.getCurrent(), "%s S%dE%d - %s", episode.showName, episode.season, episode.episode, episode.title));
119+
intent.putExtra("filename", String.format(LocaleUtils.getCurrent(), "%s S%dE%d - %s", episode.showName, episode.season, episode.episode, episode.title));
118120
}
119121
}
120122

0 commit comments

Comments
 (0)