Added support for CSV+ZIP subscriptions
Updated import instructions string
This commit is contained in:
parent
88f1c3a808
commit
e603dddc54
3 changed files with 9 additions and 3 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue