Skip to content

Commit a901cd0

Browse files
committed
Update org.redwid.android.youtube.dl:python to version 0.6.6
1 parent 11d024b commit a901cd0

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

lib/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ dependencies {
3232

3333
implementation 'com.jakewharton.timber:timber:4.7.0'
3434

35-
implementation 'org.redwid.android.youtube.dl:python:0.6.5:arm64-v8a@aar'
36-
implementation 'org.redwid.android.youtube.dl:python:0.6.5:armeabi-v7a@aar'
35+
implementation 'org.redwid.android.youtube.dl:python:0.6.6:arm64-v8a@aar'
36+
implementation 'org.redwid.android.youtube.dl:python:0.6.6:armeabi-v7a@aar'
3737

3838
testImplementation 'junit:junit:4.12'
3939
androidTestImplementation 'androidx.test:runner:1.3.0-alpha01'

lib/src/main/java/org/redwid/android/youtube/dl/TaskWorkerThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private void sleepTaskInProgress() {
6161
try {
6262
taskInProgress.wait(10000);
6363
} catch (InterruptedException e) {
64-
Timber.e(e, "EROR in sleepTaskInProgress() interrupted");
64+
Timber.e(e, "ERROR in sleepTaskInProgress() interrupted");
6565
}
6666
}
6767
Timber.i("sleepTaskInProgress() done");

lib/src/main/java/org/redwid/android/youtube/dl/YoutubeDlService.java

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
import android.os.Build;
1111
import android.os.IBinder;
1212

13+
import androidx.core.app.NotificationCompat;
14+
1315
import org.redwid.android.youtube.dl.TaskWorkerThread.TaskWorkerThreadListener;
1416
import org.redwid.youtube.dl.android.R;
1517

16-
import androidx.core.app.NotificationCompat;
1718
import timber.log.Timber;
1819

1920
/**
@@ -30,8 +31,10 @@ public class YoutubeDlService extends Service implements TaskWorkerThreadListene
3031
public static final String VALUE_TIME_OUT = "TIME_OUT";
3132

3233
public static final String NOTIFICATION_CHANNEL_ID = "youtube-dl-service";
34+
public static final int NOTIFICATION_ID = 111;
3335

3436
private TaskWorkerThread taskWorkerThread;
37+
private NotificationManager notificationManager;
3538

3639
private final IBinder binder = new LocalBinder();
3740

@@ -51,6 +54,7 @@ public IBinder onBind(Intent intent)
5154
public void onCreate() {
5255
super.onCreate();
5356
Timber.i("onCreate()");
57+
notificationManager = ((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE));
5458
startForegroundIfNeeded();
5559
taskWorkerThread = new TaskWorkerThread(this);
5660
}
@@ -67,18 +71,23 @@ public void onStart(Intent intent, int startId) {
6771
}
6872
}
6973

74+
public Notification getNotification(String title, String text) {
75+
return new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
76+
.setContentTitle(title)
77+
.setContentText(text)
78+
.build();
79+
}
80+
7081
private void startForegroundIfNeeded() {
7182
if (Build.VERSION.SDK_INT >= 26) {
7283
final NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID,
7384
getString(R.string.notification_channel_name),
7485
NotificationManager.IMPORTANCE_DEFAULT);
86+
channel.setVibrationPattern(new long[]{0L});
87+
channel.enableVibration(true);
88+
notificationManager.createNotificationChannel(channel);
7589

76-
((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel);
77-
78-
final Notification notification = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
79-
.setContentTitle("")
80-
.setContentText("").build();
81-
startForeground(1, notification);
90+
startForeground(NOTIFICATION_ID, getNotification("", ""));
8291
}
8392
}
8493

lib/src/main/java/org/redwid/android/youtube/dl/unpack/UnpackTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private boolean unpackData(final String resource, final File target, final Conte
7070
target.mkdirs();
7171

7272
final String cpuABI = getCPU_ABI();
73-
Timber.e( "cpuABI: %s", cpuABI);
73+
Timber.d( "cpuABI: %s", cpuABI);
7474
if (!assetExtract.extractTar(resource + "-" + cpuABI + ".mp3", target.getAbsolutePath())) {
7575
//toastError("Could not extract " + resource + " data.");
7676
Timber.e( "Could not extract %s data for cpu abi: %s", resource, cpuABI);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<resources>
22
<string name="app_name">lib</string>
3-
<string name="private_version">25_06_2019</string>
3+
<string name="private_version">13_06_2019</string>
44
<string name="notification_channel_name">Youtube-Dl Service</string>
55
</resources>

0 commit comments

Comments
 (0)