Skip to content

Commit

Permalink
fix premiumize
Browse files Browse the repository at this point in the history
  • Loading branch information
insomniachi committed Jun 1, 2023
1 parent 01e1051 commit 6e2ce28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Totoro.Core/Services/Debrid/PremiumizeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public async Task<IEnumerable<DirectDownloadLink>> GetDirectDownloadLinks(string
}

var json = await _api.AppendPathSegment("/transfer/directdl")
.SetQueryParam("apiKey", _apiKey)
.SetQueryParam("apikey", _apiKey)
.PostUrlEncodedAsync(new
{
src = magneticLink
Expand All @@ -138,7 +138,7 @@ public async Task<string> CreateTransfer(string magneticLink)
}

var json = await _api.AppendPathSegment("/transfer/create")
.SetQueryParam("apiKey", _apiKey)
.SetQueryParam("apikey", _apiKey)
.PostUrlEncodedAsync(new
{
src = magneticLink
Expand All @@ -158,7 +158,7 @@ public async Task<IEnumerable<Transfer>> GetTransfers()
}

var json = await _api.AppendPathSegment("/transfer/list")
.SetQueryParam("apiKey", _apiKey)
.SetQueryParam("apikey", _apiKey)
.GetStringAsync();

var jObject = JsonNode.Parse(json);
Expand All @@ -174,7 +174,7 @@ private async Task<bool> IsPremium()
}

var json = await _api.AppendPathSegment("/account/info")
.SetQueryParam("apiKey", _apiKey)
.SetQueryParam("apikey", _apiKey)
.GetStringAsync();
;
var jObject = JsonNode.Parse(json);
Expand Down
7 changes: 7 additions & 0 deletions Totoro.Core/TotoroCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ public TotoroCommands(IViewService viewService,
});
}
break;
case TorrentState.Cached:
navigationService.NavigateTo<WatchViewModel>(parameter: new Dictionary<string, object>()
{
["TorrentModel"] = model,
["UseDebrid"] = true,
});
break;
case TorrentState.NotCached:
_ = await debridServiceContext.CreateTransfer(model.Magnet);
model.State = TorrentState.Requested;
Expand Down
5 changes: 0 additions & 5 deletions Totoro.WinUI/Media/Vlc/LibVLCMediaPlayerWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ public async Task<Unit> SetMedia(VideoStreamModel stream)
? new LibVLCSharp.Shared.Media(_vlc, stream.StreamUrl, FromType.FromLocation)
: new LibVLCSharp.Shared.Media(_vlc, new StreamMediaInput(stream.Stream));

if(stream.Headers.ContainsKey(HeaderNames.Referer))
{
media.AddOption($":http-referer={stream.Headers[HeaderNames.Referer]}");
}

_mp.Media = media;
SetSubtitles(stream.AdditionalInformation.Subtitles);
return Unit.Default;
Expand Down

0 comments on commit 6e2ce28

Please sign in to comment.