Change requested track loading behavior
now TrackSearchMode.None will be used only if the local track has been found, otherwise TrackSearchMode.YouTube will be used. thanks for the great idea @Yahton (even if he stole my project) Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
6e72646e2a
commit
63005eafc9
1 changed files with 7 additions and 1 deletions
|
@ -40,7 +40,13 @@ public sealed class ControlsCommandGroup(
|
|||
return Result.FromSuccess();
|
||||
}
|
||||
|
||||
var loadResult = await audioService.Tracks.LoadTracksAsync(query, TrackSearchMode.None);
|
||||
if (File.Exists(query))
|
||||
{
|
||||
var track = await audioService.Tracks.LoadTrackAsync(Path.GetFullPath(query), TrackSearchMode.None);
|
||||
return await PlayTrackResultAsync(player, track);
|
||||
}
|
||||
|
||||
var loadResult = await audioService.Tracks.LoadTracksAsync(query, TrackSearchMode.YouTube);
|
||||
if (!loadResult.IsSuccess)
|
||||
{
|
||||
return await feedbackService.SendContextualMessageResult(
|
||||
|
|
Loading…
Reference in a new issue