Skip to content

Commit

Permalink
Added View on Emby Button (#2173)
Browse files Browse the repository at this point in the history
* Added Emby content url property

* Fetch and set the Emby url property

* Added View on Emby button to frontend and did UI work

* removed debug logging
  • Loading branch information
anojht authored and tidusjar committed Apr 19, 2018
1 parent 025797c commit 1c54eed
Show file tree
Hide file tree
Showing 21 changed files with 1,026 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Ombi.Core/Models/Search/SearchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public abstract class SearchViewModel
public bool Requested { get; set; }
public bool Available { get; set; }
public string PlexUrl { get; set; }
public string EmbyUrl { get; set; }
public string Quality { get; set; }
public abstract RequestType Type { get; }

Expand Down
1 change: 1 addition & 0 deletions src/Ombi.Core/Rule/Rules/Search/EmbyAvailabilityRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public async Task<RuleResult> Execute(SearchViewModel obj)
if (item != null)
{
obj.Available = true;
obj.EmbyUrl = item.Url;

if (obj.Type == RequestType.TvShow)
{
Expand Down
17 changes: 17 additions & 0 deletions src/Ombi.Helpers/EmbyHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Text;

namespace Ombi.Helpers
{
public class EmbyHelper
{
public static string GetEmbyMediaUrl(string mediaId)
{
var url =
$"http://app.emby.media/itemdetails.html?id={mediaId}";
return url;
}
}
}
2 changes: 2 additions & 0 deletions src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ private async Task StartServerCache(EmbyServers server)
Title = tvInfo.Name,
Type = EmbyMediaType.Series,
EmbyId = tvShow.Id,
Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id),
AddedAt = DateTime.UtcNow
});
}
Expand All @@ -135,6 +136,7 @@ private async Task ProcessMovies(MovieInformation movieInfo, ICollection<EmbyCon
Title = movieInfo.Name,
Type = EmbyMediaType.Movie,
EmbyId = movieInfo.Id,
Url = EmbyHelper.GetEmbyMediaUrl(movieInfo.Id),
AddedAt = DateTime.UtcNow,
});
}
Expand Down
1 change: 1 addition & 0 deletions src/Ombi.Store/Entities/EmbyContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class EmbyContent : Entity
public string TheMovieDbId { get; set; }
public string TvDbId { get; set; }

public string Url { get; set; }

public ICollection<EmbyEpisode> Episodes { get; set; }
}
Expand Down
Loading

0 comments on commit 1c54eed

Please sign in to comment.