Added support for CSV+ZIP subscriptions

Updated import instructions string
This commit is contained in:
talanc 2021-08-09 20:19:04 +10:00 committed by Stypox
parent 88f1c3a808
commit e603dddc54
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
3 changed files with 9 additions and 3 deletions

View file

@ -26,6 +26,7 @@ import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.documentfile.provider.DocumentFile;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import org.reactivestreams.Subscriber;
@ -89,6 +90,8 @@ public class SubscriptionsImportService extends BaseImportExportService {
private String channelUrl;
@Nullable
private InputStream inputStream;
@Nullable
private String inputStreamType;
@Override
public int onStartCommand(final Intent intent, final int flags, final int startId) {
@ -113,6 +116,9 @@ public class SubscriptionsImportService extends BaseImportExportService {
try {
inputStream = new SharpInputStream(
new StoredFileHelper(this, uri, DEFAULT_MIME).getStream());
final DocumentFile documentFile = DocumentFile.fromSingleUri(this, uri);
inputStreamType = documentFile.getType();
} catch (final IOException e) {
handleError(e);
return START_NOT_STICKY;
@ -282,7 +288,7 @@ public class SubscriptionsImportService extends BaseImportExportService {
private Flowable<List<SubscriptionItem>> importFromInputStream() {
return Flowable.fromCallable(() -> NewPipe.getService(currentServiceId)
.getSubscriptionExtractor()
.fromInputStream(inputStream));
.fromInputStream(inputStream, inputStreamType));
}
private Flowable<List<SubscriptionItem>> importFromPreviousExport() {