Skip to content

Commit

Permalink
fixup file provider
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed Jan 8, 2018
1 parent 2bace74 commit 4aa855c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tools/android/packaging/xbmc/src/XBMCJsonRPC.java.in
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ public class XBMCJsonRPC
{
JsonObject fileO = filesA.get(i).getAsJsonObject();
Uri uri = Uri.parse(fileO.get("file").getAsString());
File file = File.createFile(fileO.get("label").getAsString(), fileO.get("filetype").getAsString(), XBMCFileContentProvider.buildUri(uri.getPath()).toString());
File file = File.createFile(fileO.get("label").getAsString(), fileO.get("filetype").getAsString(), XBMCFileContentProvider.buildUri(uri.toString()).toString());
if (fileO.has("id"))
file.setId(fileO.get("id").getAsInt());
if (fileO.has("type") && !fileO.get("type").getAsString().equals("unknown"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,18 @@ public class SyncChannelJobService extends JobService
for (File file : playlistsContent)
{
sub = Subscription.createSubscription(file.getName(), file.getUri(), R.drawable.ic_recommendation_80dp);
freshsubscriptions.add(sub);

int subidx = subscriptions.indexOf(sub);
if (subidx != -1)
continue;
if (subidx == -1)
{
long channelId = TvUtil.createChannel(mContext, sub);
sub.setChannelId(channelId);
subscriptions.add(sub);
}
else
sub.setChannelId(subscriptions.get(subidx).getChannelId());

long channelId = TvUtil.createChannel(mContext, sub);
sub.setChannelId(channelId);
subscriptions.add(sub);
freshsubscriptions.add(sub);
}

// Kick off a job to update default programs.
Expand Down Expand Up @@ -203,7 +206,7 @@ public class SyncChannelJobService extends JobService
TvUtil.scheduleTriggeredSyncingProgramsForChannel(mContext, channel.getChannelId());
TvUtil.scheduleTimedSyncingProgramsForChannel(mContext, channel.getChannelId());
}
XBMCDatabase.saveSubscriptions(mContext, subscriptions);
XBMCDatabase.saveSubscriptions(mContext, freshsubscriptions);

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ public class SyncProgramsJobService extends JobService
{
Log.d(TAG, "Channel is browsable: " + channelId);

String path = Uri.parse(uri).getPath();
String xbmcURL = "special://profile" + path;
String xbmcURL = Uri.parse(uri).getFragment();
List<File> files = jsonrpc.getFiles(xbmcURL);

deletePrograms(channelId, medias);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class TvUtil
else
{
playlistIntent.setAction(Intent.ACTION_GET_CONTENT);
playlistIntent.setData(Uri.parse("special://profile" + Uri.parse(subscription.getUri()).getPath()));
playlistIntent.setData(Uri.parse(Uri.parse(subscription.getUri()).getFragment()));
}

Channel.Builder builder = new Channel.Builder();
Expand Down

0 comments on commit 4aa855c

Please sign in to comment.