public SubsonicLibrary(SubsonicSession s) { session = s; RootFolderKey = "-1"; RootEmptyMessage = "Successfully connected to Subsonic at " + session.Describe + ", however the music library is empty. Follow the Subsonic server documentation to add MP3s to the library. Refresh the library of this app when you're done."; ServerSupportsPlaylists = true; var t = Utils.SuppressAsync <Exception>(Ping); }
public async Task Test(MusicEndpoint endpoint) { string userFeedback = null; RemoteBase session = null; try { switch (endpoint.EndpointType) { case EndpointTypes.Local: break; case EndpointTypes.MusicPimp: session = ProviderService.Instance.NewPimpSession(endpoint); break; case EndpointTypes.PimpCloud: session = new CloudSession(endpoint); break; case EndpointTypes.Subsonic: session = new SubsonicSession(endpoint); break; } if (session != null) { try { FeedbackMessage = String.Empty; IsLoading = true; await session.TestConnectivity(); userFeedback = "Connection successfully established."; } finally { IsLoading = false; } } } catch (UnauthorizedException) { userFeedback = "Check your credentials."; } catch (ConnectivityException) { userFeedback = GetFeedback(endpoint, session); } catch (NotFoundException) { userFeedback = GetFeedback(endpoint, session); } catch (PimpException pe) { userFeedback = pe.Message; } catch (ServerResponseException sre) { userFeedback = sre.Message; } catch (HttpRequestException) { userFeedback = GetFeedback(endpoint, session); } catch (Exception) { userFeedback = "Something went wrong. Please check that all the fields are filled in properly."; } if (userFeedback != null) { OnFeedback(userFeedback); } }
public SubsonicPlaylist(SubsonicSession s) { session = s; }
//public SubsonicConverter Converter { get; protected set; } public SubsonicPlayer(SubsonicSession s) { session = s; Playlist = new SubsonicPlaylist(session); }