Beispiel #1
0
        private string SetContext([NotNull] Context ctx)
        {
            var uri = ctx.Uri;

            Context = AbsSpotifyContext.From(uri);
            ConnectState.ContextUri = uri;

            if (!Context.IsFinite())
            {
                SetRepeatingContext(false);
                SetShufflingContext(false);
            }

            if (ctx.HasUrl)
            {
                this.ConnectState.ContextUrl = ctx.Url;
            }
            else
            {
                this.ConnectState.ContextUrl = String.Empty;
            }

            ConnectState.ContextMetadata.Clear();
            ProtoUtils.CopyOverMetadata(ctx, ConnectState);

            this.Pages        = PagesLoader.From(Session, ctx);
            this.TracksKeeper = new TracksKeeper(this);

            this.SpotifyDevice.SetIsActive(true);

            return(RenewSessionId());
        }
Beispiel #2
0
        private string SetContext([NotNull] string uri)
        {
            this.Context = AbsSpotifyContext.From(uri);
            this.ConnectState.ContextUri = uri;

            if (!Context.IsFinite())
            {
                SetRepeatingContext(false);
                SetShufflingContext(false);
            }

            this.ConnectState.ContextUrl          = "";
            this.ConnectState.Restrictions        = null;
            this.ConnectState.ContextRestrictions = null;
            this.ConnectState.ContextMetadata.Clear();
            this.Pages        = PagesLoader.From(Session, uri);
            this.TracksKeeper = new TracksKeeper(this);

            this.SpotifyDevice.SetIsActive(true);
            return(RenewSessionId());
        }