Move download service to module (#7041)

This commit is contained in:
ByteHamster 2024-03-29 19:27:53 +01:00 committed by GitHub
parent 6f3a9b1676
commit 2fd73b148d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
46 changed files with 134 additions and 84 deletions

View File

@ -68,7 +68,10 @@ dependencies {
implementation project(':net:common')
implementation project(':net:discovery')
implementation project(':net:download:service-interface')
implementation project(':net:download:service')
implementation project(':net:ssl')
implementation project(':net:sync:gpoddernet')
implementation project(':net:sync:service')
implementation project(':net:sync:model')
implementation project(':parser:feed')
implementation project(':playback:base')
@ -83,6 +86,7 @@ dependencies {
implementation project(':ui:episodes')
implementation project(':ui:glide')
implementation project(':ui:i18n')
implementation project(':ui:notifications')
implementation project(':ui:widget')
implementation project(':ui:preferences')
implementation project(':ui:statistics')

View File

@ -8,11 +8,11 @@ import java.io.File;
import java.io.IOException;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.net.download.service.feed.remote.Downloader;
import de.danoeh.antennapod.net.download.service.feed.remote.HttpDownloader;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.model.download.DownloadRequest;
import de.danoeh.antennapod.model.download.DownloadResult;
import de.danoeh.antennapod.core.service.download.Downloader;
import de.danoeh.antennapod.core.service.download.HttpDownloader;
import de.danoeh.antennapod.model.download.DownloadError;
import de.test.antennapod.util.service.download.HTTPBin;
import org.junit.After;

View File

@ -33,7 +33,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:backupAgent=".core.backup.OpmlBackupAgent"
android:backupAgent=".storage.importexport.OpmlBackupAgent"
android:restoreAnyVersion="true"
android:theme="@style/Theme.AntennaPod.Splash"
android:usesCleartextTraffic="true"

View File

@ -1,10 +1,10 @@
package de.danoeh.antennapod.core;
package de.danoeh.antennapod;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import de.danoeh.antennapod.core.storage.AutoDownloadManagerImpl;
import de.danoeh.antennapod.core.util.download.FeedUpdateManagerImpl;
import de.danoeh.antennapod.net.download.service.feed.FeedUpdateManagerImpl;
import de.danoeh.antennapod.net.download.serviceinterface.AutoDownloadManager;
import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
import de.danoeh.antennapod.net.sync.service.SyncService;
@ -18,7 +18,7 @@ import de.danoeh.antennapod.net.common.UserAgentInterceptor;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.net.common.AntennapodHttpClient;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterface;
import de.danoeh.antennapod.core.service.download.DownloadServiceInterfaceImpl;
import de.danoeh.antennapod.net.download.service.feed.DownloadServiceInterfaceImpl;
import de.danoeh.antennapod.net.common.NetworkUtils;
import de.danoeh.antennapod.core.util.download.NetworkConnectionChangeHandler;
import de.danoeh.antennapod.net.ssl.SslProviderInstaller;

View File

@ -6,7 +6,6 @@ import android.os.StrictMode;
import com.google.android.material.color.DynamicColors;
import de.danoeh.antennapod.core.ApCoreEventBusIndex;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.error.CrashReportWriter;
import de.danoeh.antennapod.error.RxJavaErrorHandlerSetup;
import de.danoeh.antennapod.preferences.PreferenceUpgrader;

View File

@ -35,7 +35,7 @@ import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.snackbar.Snackbar;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.util.download.FeedUpdateManagerImpl;
import de.danoeh.antennapod.net.download.service.feed.FeedUpdateManagerImpl;
import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
import de.danoeh.antennapod.net.sync.serviceinterface.SynchronizationQueueSink;
import de.danoeh.antennapod.ui.appstartintent.MediaButtonStarter;

View File

@ -28,9 +28,11 @@ import com.google.android.material.snackbar.Snackbar;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.adapter.FeedItemlistDescriptionAdapter;
import de.danoeh.antennapod.net.download.service.feed.remote.Downloader;
import de.danoeh.antennapod.net.download.service.feed.remote.HttpDownloader;
import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter;
import de.danoeh.antennapod.ui.common.ThemeSwitcher;
import de.danoeh.antennapod.core.service.download.DownloadRequestCreator;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequestCreator;
import de.danoeh.antennapod.net.discovery.FeedUrlNotFoundException;
import de.danoeh.antennapod.storage.database.FeedDatabaseWriter;
import de.danoeh.antennapod.core.service.playback.PlaybackServiceInterface;
@ -45,8 +47,6 @@ import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterfa
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.model.download.DownloadRequest;
import de.danoeh.antennapod.model.download.DownloadResult;
import de.danoeh.antennapod.core.service.download.Downloader;
import de.danoeh.antennapod.core.service.download.HttpDownloader;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.net.discovery.CombinedSearcher;

View File

@ -7,7 +7,7 @@ import android.net.ConnectivityManager;
import android.text.TextUtils;
import android.util.Log;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.ClientConfigurator;
import de.danoeh.antennapod.core.util.download.NetworkConnectionChangeHandler;
public class ConnectivityActionReceiver extends BroadcastReceiver {

View File

@ -5,7 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.util.Log;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.ClientConfigurator;
import de.danoeh.antennapod.net.download.serviceinterface.AutoDownloadManager;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterface;

View File

@ -11,7 +11,7 @@ import java.util.Arrays;
import java.util.Collections;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.ClientConfigurator;
import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
import de.danoeh.antennapod.storage.database.FeedDatabaseWriter;
import de.danoeh.antennapod.model.feed.Feed;

View File

@ -27,22 +27,16 @@ dependencies {
implementation project(':model')
implementation project(':net:common')
implementation project(':net:download:service-interface')
implementation project(':net:ssl')
implementation project(':net:sync:gpoddernet')
implementation project(':net:sync:model')
implementation project(':net:sync:service')
implementation project(':net:sync:service-interface')
implementation project(':parser:feed')
implementation project(':parser:media')
implementation project(':playback:base')
implementation project(':playback:cast')
implementation project(':storage:database')
implementation project(':storage:importexport')
implementation project(':storage:preferences')
implementation project(':ui:app-start-intent')
implementation project(':ui:common')
implementation project(':ui:episodes')
implementation project(':ui:i18n')
implementation project(':ui:notifications')
implementation project(':ui:widget')

View File

@ -5,7 +5,6 @@ import android.content.Context;
import android.content.Intent;
import android.util.Log;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
/**
@ -18,8 +17,6 @@ public class FeedUpdateReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "Received intent");
ClientConfigurator.initialize(context);
FeedUpdateManager.getInstance().runOnce(context);
}

View File

@ -7,8 +7,6 @@ import androidx.core.content.ContextCompat;
import android.util.Log;
import android.view.KeyEvent;
import de.danoeh.antennapod.core.ClientConfigurator;
/**
* Receives media button events.
*/
@ -30,7 +28,6 @@ public class MediaButtonReceiver extends BroadcastReceiver {
}
KeyEvent event = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);
if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
ClientConfigurator.initialize(context);
Intent serviceIntent = new Intent(PLAYBACK_SERVICE_INTENT);
serviceIntent.setPackage(context.getPackageName());
serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode());

View File

@ -16,10 +16,6 @@
<item name="view_type_episode_item" type="id"/>
<!-- Notifications need unique IDs to update/cancel them -->
<item name="notification_downloading" type="id"/>
<item name="notification_updating_feeds" type="id"/>
<item name="notification_download_report" type="id"/>
<item name="notification_auto_download_report" type="id"/>
<item name="notification_playing" type="id"/>
<item name="notification_streaming_confirmation" type="id"/>
</resources>

View File

@ -5,6 +5,7 @@ import android.text.TextUtils;
import java.io.File;
import de.danoeh.antennapod.net.download.serviceinterface.FileNameGenerator;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -16,8 +16,11 @@ android {
dependencies {
implementation project(':model')
implementation project(':net:common')
implementation project(':storage:preferences')
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
implementation "commons-io:commons-io:$commonsioVersion"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"

View File

@ -1,12 +1,10 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.serviceinterface;
import android.util.Log;
import android.webkit.URLUtil;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequestBuilder;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.core.util.FileNameGenerator;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedMedia;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
import org.apache.commons.io.FilenameUtils;
import java.io.File;
@ -22,7 +20,8 @@ public class DownloadRequestCreator {
public static DownloadRequestBuilder create(Feed feed) {
File dest = new File(getFeedfilePath(), getFeedfileName(feed));
if (dest.exists()) {
dest.delete();
boolean deleted = dest.delete();
Log.d(TAG, "deleted" + dest.getPath() + ": " + deleted);
}
Log.d(TAG, "Requesting download of url " + feed.getDownloadUrl());

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.util;
package de.danoeh.antennapod.net.download.serviceinterface;
import android.text.TextUtils;

View File

@ -0,0 +1,3 @@
# :net:download:service
The download service.

View File

@ -0,0 +1,47 @@
plugins {
id("com.android.library")
id("java-test-fixtures")
}
apply from: "../../../common.gradle"
apply from: "../../../playFlavor.gradle"
android {
namespace "de.danoeh.antennapod.net.download.service"
}
dependencies {
implementation project(":core")
implementation project(':event')
implementation project(':model')
implementation project(':net:common')
implementation project(':net:download:service-interface')
implementation project(':net:sync:model')
implementation project(':net:sync:service-interface')
implementation project(':parser:media')
implementation project(':parser:feed')
implementation project(':storage:database')
implementation project(':ui:notifications')
implementation project(':storage:preferences')
implementation project(':ui:app-start-intent')
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.core:core:$coreVersion"
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation "androidx.work:work-runtime:$workManagerVersion"
implementation "com.google.android.material:material:$googleMaterialVersion"
implementation "com.squareup.okhttp3:okhttp:$okhttpVersion"
implementation "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
implementation "commons-io:commons-io:$commonsioVersion"
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
implementation "org.greenrobot:eventbus:$eventbusVersion"
implementation "com.github.bumptech.glide:glide:$glideVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "com.google.guava:guava:31.0.1-android"
testImplementation "junit:junit:$junitVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
testImplementation "org.awaitility:awaitility:$awaitilityVersion"
testImplementation 'org.mockito:mockito-core:5.11.0'
}

View File

@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
</manifest>

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.episode;
import android.Manifest;
import android.app.Notification;
@ -19,9 +19,10 @@ import androidx.work.Worker;
import androidx.work.WorkerParameters;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.service.download.handler.MediaDownloadedHandler;
import de.danoeh.antennapod.net.download.service.R;
import de.danoeh.antennapod.net.download.service.feed.remote.DefaultDownloaderFactory;
import de.danoeh.antennapod.net.download.service.feed.remote.Downloader;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequestCreator;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.event.MessageEvent;
@ -55,7 +56,6 @@ public class EpisodeDownloadWorker extends Worker {
@Override
@NonNull
public Result doWork() {
ClientConfigurator.initialize(getApplicationContext());
long mediaId = getInputData().getLong(DownloadServiceInterface.WORK_DATA_MEDIA_ID, 0);
FeedMedia media = DBReader.getFeedMedia(mediaId);
if (media == null) {

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download.handler;
package de.danoeh.antennapod.net.download.service.episode;
import android.content.Context;
import android.media.MediaMetadataRetriever;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.feed;
import android.content.Context;
import androidx.work.Constraints;
@ -9,6 +9,7 @@ import androidx.work.OneTimeWorkRequest;
import androidx.work.OutOfQuotaPolicy;
import androidx.work.WorkInfo;
import androidx.work.WorkManager;
import de.danoeh.antennapod.net.download.service.episode.EpisodeDownloadWorker;
import de.danoeh.antennapod.storage.database.DBWriter;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedMedia;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.util.download;
package de.danoeh.antennapod.net.download.service.feed;
import android.content.Context;
import android.util.Log;
@ -15,7 +15,6 @@ import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.service.FeedUpdateWorker;
import de.danoeh.antennapod.net.common.NetworkUtils;
import de.danoeh.antennapod.event.MessageEvent;
import de.danoeh.antennapod.model.feed.Feed;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service;
package de.danoeh.antennapod.net.download.service.feed;
import android.Manifest;
import android.app.Notification;
@ -16,16 +16,13 @@ import androidx.work.Worker;
import androidx.work.WorkerParameters;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import de.danoeh.antennapod.core.ClientConfigurator;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.feed.LocalFeedUpdater;
import de.danoeh.antennapod.core.service.download.DefaultDownloaderFactory;
import de.danoeh.antennapod.core.service.download.DownloadRequestCreator;
import de.danoeh.antennapod.core.service.download.Downloader;
import de.danoeh.antennapod.core.service.download.NewEpisodesNotification;
import de.danoeh.antennapod.core.service.download.handler.FeedParserTask;
import de.danoeh.antennapod.core.util.download.FeedUpdateManagerImpl;
import de.danoeh.antennapod.net.download.service.R;
import de.danoeh.antennapod.net.download.service.feed.local.LocalFeedUpdater;
import de.danoeh.antennapod.net.download.service.feed.remote.DefaultDownloaderFactory;
import de.danoeh.antennapod.net.download.service.feed.remote.Downloader;
import de.danoeh.antennapod.net.download.service.feed.remote.FeedParserTask;
import de.danoeh.antennapod.net.download.serviceinterface.AutoDownloadManager;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequestCreator;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.FeedDatabaseWriter;
import de.danoeh.antennapod.storage.database.DBWriter;
@ -58,7 +55,6 @@ public class FeedUpdateWorker extends Worker {
@Override
@NonNull
public Result doWork() {
ClientConfigurator.initialize(getApplicationContext());
newEpisodesNotification.loadCountersBeforeRefresh();
List<Feed> toUpdate;
@ -125,14 +121,14 @@ public class FeedUpdateWorker extends Worker {
.setStyle(new NotificationCompat.BigTextStyle().bigText(bigText))
.setSmallIcon(R.drawable.ic_notification_sync)
.setOngoing(true)
.addAction(R.drawable.ic_cancel, context.getString(R.string.cancel_label),
.addAction(R.drawable.ic_notification_cancel, context.getString(R.string.cancel_label),
WorkManager.getInstance(context).createCancelPendingIntent(getId()))
.build();
}
@NonNull
@Override
public ListenableFuture<ForegroundInfo> getForegroundInfoAsync() {
public ListenableFuture getForegroundInfoAsync() {
return Futures.immediateFuture(new ForegroundInfo(R.id.notification_updating_feeds, createNotification(null)));
}

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.feed;
import android.Manifest;
import android.app.Notification;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.util;
package de.danoeh.antennapod.net.download.service.feed.local;
import android.content.Context;
import android.database.Cursor;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.feed;
package de.danoeh.antennapod.net.download.service.feed.local;
import android.content.Context;
import android.media.MediaMetadataRetriever;
@ -26,10 +26,9 @@ import java.util.UUID;
import androidx.annotation.VisibleForTesting;
import androidx.documentfile.provider.DocumentFile;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.util.FastDocumentFile;
import de.danoeh.antennapod.model.MediaMetadataRetrieverCompat;
import de.danoeh.antennapod.model.download.DownloadResult;
import de.danoeh.antennapod.net.download.service.R;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.FeedDatabaseWriter;
import de.danoeh.antennapod.storage.database.DBWriter;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.feed.remote;
import android.util.Log;
import android.webkit.URLUtil;

View File

@ -1,13 +1,13 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.feed.remote;
import androidx.annotation.NonNull;
import java.util.Date;
import java.util.concurrent.Callable;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.model.download.DownloadResult;
import de.danoeh.antennapod.model.download.DownloadRequest;
import de.danoeh.antennapod.net.download.service.R;
/**
* Downloads files

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.feed.remote;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download.handler;
package de.danoeh.antennapod.net.download.service.feed.remote;
import android.text.TextUtils;
import android.util.Log;
@ -13,7 +13,6 @@ import de.danoeh.antennapod.parser.feed.FeedHandler;
import de.danoeh.antennapod.parser.feed.FeedHandlerResult;
import de.danoeh.antennapod.parser.feed.UnsupportedFeedtypeException;
import de.danoeh.antennapod.model.download.DownloadError;
import de.danoeh.antennapod.core.util.InvalidFeedException;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.service.download;
package de.danoeh.antennapod.net.download.service.feed.remote;
import androidx.annotation.NonNull;
import android.text.TextUtils;
@ -8,6 +8,7 @@ import de.danoeh.antennapod.net.common.NetworkUtils;
import de.danoeh.antennapod.model.download.DownloadResult;
import de.danoeh.antennapod.model.download.DownloadRequest;
import de.danoeh.antennapod.net.common.AntennapodHttpClient;
import de.danoeh.antennapod.net.download.service.R;
import okhttp3.CacheControl;
import okhttp3.internal.http.StatusLine;
import org.apache.commons.io.IOUtils;
@ -24,8 +25,8 @@ import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Locale;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.model.feed.FeedMedia;
import de.danoeh.antennapod.parser.feed.util.DateUtils;
import de.danoeh.antennapod.model.download.DownloadError;
@ -98,7 +99,7 @@ public class HttpDownloader extends Downloader {
String contentEncodingHeader = response.header("Content-Encoding");
boolean isGzip = false;
if (!TextUtils.isEmpty(contentEncodingHeader)) {
isGzip = TextUtils.equals(contentEncodingHeader.toLowerCase(), "gzip");
isGzip = TextUtils.equals(contentEncodingHeader.toLowerCase(Locale.US), "gzip");
}
Log.d(TAG, "Response code is " + response.code());

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.util;
package de.danoeh.antennapod.net.download.service.feed.remote;
/**
* Thrown if a feed has invalid attribute values.

View File

@ -0,0 +1,6 @@
<resources>
<item name="notification_downloading" type="id"/>
<item name="notification_updating_feeds" type="id"/>
<item name="notification_download_report" type="id"/>
<item name="notification_auto_download_report" type="id"/>
</resources>

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.feed;
package de.danoeh.antennapod.net.download.service.feed.local;
import android.content.Context;
import android.media.MediaMetadataRetriever;
@ -11,7 +11,6 @@ import androidx.test.platform.app.InstrumentationRegistry;
import de.danoeh.antennapod.storage.preferences.PlaybackPreferences;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterface;
import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterfaceStub;
import de.danoeh.antennapod.core.util.FastDocumentFile;
import de.danoeh.antennapod.model.feed.Feed;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.storage.database.PodDBAdapter;
@ -37,13 +36,13 @@ import de.danoeh.antennapod.storage.preferences.UserPreferences;
import de.danoeh.antennapod.storage.database.DBReader;
import de.danoeh.antennapod.storage.database.DBWriter;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.endsWith;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.any;
import static org.mockito.ArgumentMatchers.any;
import static org.robolectric.Shadows.shadowOf;
/**

View File

@ -23,6 +23,7 @@ include ':model'
include ':net:common'
include ':net:discovery'
include ':net:download:service-interface'
include ':net:download:service'
include ':net:ssl'
include ':net:sync:gpoddernet'
include ':net:sync:model'

View File

@ -15,6 +15,7 @@ dependencies {
implementation project(':ui:i18n')
implementation project(':ui:notifications')
implementation project(':model')
implementation project(':net:download:service-interface')
annotationProcessor "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.core:core:$coreVersion"

View File

@ -1,4 +1,4 @@
package de.danoeh.antennapod.core.backup;
package de.danoeh.antennapod.storage.importexport;
import android.app.backup.BackupAgentHelper;
import android.app.backup.BackupDataInputStream;
@ -10,9 +10,6 @@ import android.util.Log;
import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
import de.danoeh.antennapod.storage.database.FeedDatabaseWriter;
import de.danoeh.antennapod.storage.importexport.OpmlElement;
import de.danoeh.antennapod.storage.importexport.OpmlReader;
import de.danoeh.antennapod.storage.importexport.OpmlWriter;
import org.apache.commons.io.IOUtils;
import org.xmlpull.v1.XmlPullParserException;

View File

@ -0,0 +1,5 @@
<vector android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
</vector>

View File

@ -24,7 +24,6 @@ import de.danoeh.antennapod.net.sync.serviceinterface.SynchronizationProviderVie
import de.danoeh.antennapod.net.sync.serviceinterface.SynchronizationQueueSink;
import de.danoeh.antennapod.storage.preferences.SynchronizationCredentials;
import de.danoeh.antennapod.storage.preferences.SynchronizationSettings;
import de.danoeh.antennapod.core.util.FileNameGenerator;
import de.danoeh.antennapod.net.sync.gpoddernet.GpodnetService;
import de.danoeh.antennapod.net.sync.gpoddernet.model.GpodnetDevice;
import de.danoeh.antennapod.ui.preferences.R;
@ -215,7 +214,7 @@ public class GpodderAuthenticationFragment extends DialogFragment {
private String generateDeviceId(String name) {
// devices names must be of a certain form:
// https://gpoddernet.readthedocs.org/en/latest/api/reference/general.html#devices
return FileNameGenerator.generateFileName(name).replaceAll("\\W", "_").toLowerCase(Locale.US);
return name.replaceAll("[^a-zA-Z0-9]", "_").toLowerCase(Locale.US);
}
private boolean isDeviceInList(String name) {