Skip to content

Commit

Permalink
Merge pull request #140 from tidusjar/dev
Browse files Browse the repository at this point in the history
Merge dev to master. Release 1.6
  • Loading branch information
Jamie committed Apr 6, 2016
2 parents 10c47d3 + 08cbf92 commit 3277830
Show file tree
Hide file tree
Showing 113 changed files with 5,751 additions and 711 deletions.
1 change: 1 addition & 0 deletions PlexRequests.Api.Interfaces/IApiRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ namespace PlexRequests.Api.Interfaces
public interface IApiRequest
{
T Execute<T>(IRestRequest request, Uri baseUri) where T : new();
IRestResponse Execute(IRestRequest request, Uri baseUri);
T ExecuteXml<T>(IRestRequest request, Uri baseUri) where T : class;
T ExecuteJson<T>(IRestRequest request, Uri baseUri) where T : new();
}
Expand Down
44 changes: 44 additions & 0 deletions PlexRequests.Api.Interfaces/IHeadphonesApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: IHeadphonesApi.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

using PlexRequests.Api.Models.Music;

namespace PlexRequests.Api.Interfaces
{
public interface IHeadphonesApi
{
Task<bool> AddAlbum(string apiKey, Uri baseUrl, string albumId);
HeadphonesVersion GetVersion(string apiKey, Uri baseUrl);
Task<bool> AddArtist(string apiKey, Uri baseUrl, string artistId);
Task<bool> QueueAlbum(string apiKey, Uri baseUrl, string albumId);
Task<List<HeadphonesGetIndex>> GetIndex(string apiKey, Uri baseUrl);
Task<bool> RefreshArtist(string apiKey, Uri baseUrl, string artistId);
}
}
37 changes: 37 additions & 0 deletions PlexRequests.Api.Interfaces/IMusicBrainzApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: IMusicBrainzApi.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using PlexRequests.Api.Models.Music;

namespace PlexRequests.Api.Interfaces
{
public interface IMusicBrainzApi
{
MusicBrainzSearchResults SearchAlbum(string searchTerm);
MusicBrainzCoverArt GetCoverArt(string releaseId);
MusicBrainzReleaseInfo GetAlbum(string releaseId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
<ItemGroup>
<Compile Include="IApiRequest.cs" />
<Compile Include="ICouchPotatoApi.cs" />
<Compile Include="IHeadphonesApi.cs" />
<Compile Include="IMusicBrainzApi.cs" />
<Compile Include="IPlexApi.cs" />
<Compile Include="IPushbulletApi.cs" />
<Compile Include="IPushoverApi.cs" />
Expand Down
45 changes: 45 additions & 0 deletions PlexRequests.Api.Models/Music/HeadphonesAlbumSearchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: HeadphonesAlbumSearchResult.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
{
public class HeadphonesAlbumSearchResult
{
public string rgid { get; set; }
public string albumurl { get; set; }
public string tracks { get; set; }
public string date { get; set; }
public string id { get; set; } // Artist ID
public string rgtype { get; set; }
public string title { get; set; }
public string url { get; set; }
public string country { get; set; }
public string albumid { get; set; } // AlbumId
public int score { get; set; }
public string uniquename { get; set; }
public string formats { get; set; }
}
}
37 changes: 37 additions & 0 deletions PlexRequests.Api.Models/Music/HeadphonesArtistSearchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: HeadphonesSearchResult.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
{
public class HeadphonesArtistSearchResult
{
public string url { get; set; } // MusicBrainz url
public int score { get; set; } // Search Match score?
public string name { get; set; } // Artist Name
public string uniquename { get; set; } // Artist Unique Name
public string id { get; set; } // Artist Unique ID for MusicBrainz
}
}
49 changes: 49 additions & 0 deletions PlexRequests.Api.Models/Music/HeadphonesGetIndex.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: HeadphonesGetIndex.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
{
public class HeadphonesGetIndex
{
public string Status { get; set; }
public string ThumbURL { get; set; }
public string DateAdded { get; set; }
public string MetaCritic { get; set; }
public int? TotalTracks { get; set; }
public object Type { get; set; }
public int? IncludeExtras { get; set; }
public string ArtistName { get; set; }
public string LastUpdated { get; set; }
public string ReleaseDate { get; set; }
public string AlbumID { get; set; }
public string ArtistID { get; set; }
public string ArtworkURL { get; set; }
public string Extras { get; set; }
public int? HaveTracks { get; set; }
public string LatestAlbum { get; set; }
public string ArtistSortName { get; set; }
}
}
37 changes: 37 additions & 0 deletions PlexRequests.Api.Models/Music/HeadphonesVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: HeadphonesVersion.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
namespace PlexRequests.Api.Models.Music
{
public class HeadphonesVersion
{
public string install_type { get; set; }
public object current_version { get; set; }
public string git_path { get; set; }
public string latest_version { get; set; }
public int commits_behind { get; set; }
}
}
55 changes: 55 additions & 0 deletions PlexRequests.Api.Models/Music/MusicBrainzCoverArt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: MusicBrainzCoverArt.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;

namespace PlexRequests.Api.Models.Music
{
public class Thumbnails
{
public string large { get; set; }
public string small { get; set; }
}

public class Image
{
public List<string> types { get; set; }
public bool front { get; set; }
public bool back { get; set; }
public int edit { get; set; }
public string image { get; set; }
public string comment { get; set; }
public bool approved { get; set; }
public string id { get; set; }
public Thumbnails thumbnails { get; set; }
}

public class MusicBrainzCoverArt
{
public List<Image> images { get; set; }
public string release { get; set; }
}
}
Loading

0 comments on commit 3277830

Please sign in to comment.