public async Task <bool> Scrobble(ILastAuth Auth, params string[] data) { IFolder rootFolder = FileSystem.Current.LocalStorage; IFolder folder = await rootFolder.CreateFolderAsync("db", CreationCollisionOption.OpenIfExists); IFile file = await folder.CreateFileAsync("scrobbles.db", CreationCollisionOption.ReplaceExisting); IScrobbler _scrobbler = new BreadScrobbler(Auth, file.Path); return((await _scrobbler.ScrobbleAsync(new IF.Lastfm.Core.Objects.Scrobble(data[0], data[1], data[2], DateTimeOffset.Now))).Success); }
public async Task <ScrobbleResponse> Scrobble(params string[] data) { try { if (!LastfmClient.Auth.Authenticated) { return(new ScrobbleResponse(LastResponseStatus.BadAuth)); } IFolder rootFolder = FileSystem.Current.LocalStorage; IFolder folder = await rootFolder.CreateFolderAsync("db", CreationCollisionOption.OpenIfExists); IFile file = await folder.CreateFileAsync("scrobbles.db", CreationCollisionOption.OpenIfExists); IScrobbler scrobbler = new BreadScrobbler(LastfmClient.Auth, file.Path); return(await scrobbler.ScrobbleAsync(new Scrobble(data[0], data[1], data[2], DateTimeOffset.Now))); } catch (NullReferenceException) { return(new ScrobbleResponse(LastResponseStatus.Failure)); } }