Skip to content

Commit

Permalink
Merge pull request #2226 from tidusjar/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tidusjar authored May 5, 2018
2 parents 794ce21 + 09985df commit 6391988
Show file tree
Hide file tree
Showing 43 changed files with 1,118 additions and 545 deletions.
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# Changelog

## (unreleased)

### **New Features**

- Added a check for long movie descriptions and dealt with accordingly. [Anojh]

- Update jobs.component.html. [D34DC3N73R]

- Added id to emby button to distinguish for UI purposes. [Anojh]

- Changed theme content textarea to use monospace font. [Anojh]

- Added classes and ids to issue status. [Anojh]

- Changed overlay picture to poster pic so we have fallback styling on older clients. [Anojh]

### **Fixes**

- Fixed #2224. [Jamie]

- More robust check for release date. [Anojh]

- Fixed duplicate titles in Plex Newsletter. [Anojh]

- Fixed the filter on the Requests page #2219 and added the default sort to be most recent requests. [Jamie Rees]

- Enable the mobile ntoifications inside Ombi. [Jamie Rees]

- Made the episode list in the newsletter easier to read. Rather than 1,2,3,4,5,10 we will now show 1-5, 10. [Jamie Rees]

- Moved the RecentlyAddedSync into it's own job, it still is calls the regular sync but this should make it easier to start the job from the UI (When I add that) [Jamie Rees]

- Made a massive improvement on the Smaller more frequent Plex Job. This should pick up content a lot quicker now and also get their metadata a lot quicker. [Jamie Rees]

- Trigger a metadata refresh when we finish scanning the libraries. [Jamie Rees]

- Fixed a potential issue in the newsletter where it wouldn't send content due to missing metadata, but would mark it as if it was sent. [Jamie Rees]

- Fixed settings retaining active class when elsewhere in UI. [Anojh]

- Separated user and subject details into spans and fixed styling. [Anojh]

- Fixed linting errors. [Anojh]

- Fixed settings nav item not retaining active class when in other tabs in the settings page. [Anojh]

- Separated reported by and subject and added classes. [Anojh]

- Fix for issue #2152. [Anojh]

- Fix genres being ambigious error. [Anojh]

- Made text style justified. [Anojh]

- V1.0, needs TV background and needs styles for outlook. [Anojh]

- CSS done for the template. [Anojh]

- Fixing some format issues. [Anojh]

- Newsletter template structure done. [Anojh]


## v3.0.3268 (2018-04-28)

### **Fixes**
Expand Down
8 changes: 4 additions & 4 deletions src/Ombi.Api.Plex/Models/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ public class Metadata
public string summary { get; set; }
public int index { get; set; }
public float rating { get; set; }
public int viewCount { get; set; }
public int lastViewedAt { get; set; }
//public int viewCount { get; set; }
//public int lastViewedAt { get; set; }
public int year { get; set; }
public string thumb { get; set; }
public string art { get; set; }
public string banner { get; set; }
public string theme { get; set; }
public string duration { get; set; }
public string originallyAvailableAt { get; set; }
//public string duration { get; set; }
//public string originallyAvailableAt { get; set; }
public int leafCount { get; set; }
public int viewedLeafCount { get; set; }
public int childCount { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Ombi.Core/Engine/Interfaces/IMovieRequestEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface IMovieRequestEngine : IRequestEngine<MovieRequests>
Task<RequestEngineResult> ApproveMovie(MovieRequests request);
Task<RequestEngineResult> ApproveMovieById(int requestId);
Task<RequestEngineResult> DenyMovieById(int modelId);
Task<IEnumerable<MovieRequests>> Filter(FilterViewModel vm);
Task<FilterResult<MovieRequests>> Filter(FilterViewModel vm);

}
}
20 changes: 15 additions & 5 deletions src/Ombi.Core/Engine/MovieRequestEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ public async Task<IEnumerable<MovieRequests>> GetRequests(int count, int positio
List<MovieRequests> allRequests;
if (shouldHide.Hide)
{
allRequests = await MovieRepository.GetWithUser(shouldHide.UserId).Skip(position).Take(count).ToListAsync();
allRequests = await MovieRepository.GetWithUser(shouldHide.UserId).Skip(position).Take(count).OrderByDescending(x => x.ReleaseDate).ToListAsync();
}
else
{
allRequests = await MovieRepository.GetWithUser().Skip(position).Take(count).ToListAsync();
allRequests = await MovieRepository.GetWithUser().Skip(position).Take(count).OrderByDescending(x => x.ReleaseDate).ToListAsync();
}
allRequests.ForEach(x =>
{
Expand Down Expand Up @@ -380,10 +380,13 @@ await _requestLog.Add(new RequestLog
return new RequestEngineResult { Result = true, Message = $"{movieName} has been successfully added!" };
}

public async Task<IEnumerable<MovieRequests>> Filter(FilterViewModel vm)
public async Task<FilterResult<MovieRequests>> Filter(FilterViewModel vm)
{
var shouldHide = await HideFromOtherUsers();
var requests = shouldHide.Hide ? MovieRepository.GetWithUser(shouldHide.UserId) : MovieRepository.GetWithUser();
var requests = shouldHide.Hide
? MovieRepository.GetWithUser(shouldHide.UserId)
: MovieRepository.GetWithUser();

switch (vm.AvailabilityFilter)
{
case FilterType.None:
Expand Down Expand Up @@ -415,7 +418,14 @@ public async Task<IEnumerable<MovieRequests>> Filter(FilterViewModel vm)
throw new ArgumentOutOfRangeException();
}

return requests;
var count = await requests.CountAsync();
requests = requests.Skip(vm.Position).Take(vm.Count);
var retVal = new FilterResult<MovieRequests>
{
Total = count,
Collection = requests
};
return retVal;
}
}
}
4 changes: 2 additions & 2 deletions src/Ombi.Core/Engine/TvRequestEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public async Task<IEnumerable<TvRequests>> GetRequests(int count, int position)
.Include(x => x.ChildRequests)
.ThenInclude(x => x.SeasonRequests)
.ThenInclude(x => x.Episodes)
.Skip(position).Take(count).ToListAsync();
.Skip(position).Take(count).OrderByDescending(x => x.ReleaseDate).ToListAsync();

// Filter out children

Expand All @@ -153,7 +153,7 @@ public async Task<IEnumerable<TvRequests>> GetRequests(int count, int position)
.Include(x => x.ChildRequests)
.ThenInclude(x => x.SeasonRequests)
.ThenInclude(x => x.Episodes)
.Skip(position).Take(count).ToListAsync();
.Skip(position).Take(count).OrderByDescending(x => x.ReleaseDate).ToListAsync();
}

return allRequests;
Expand Down
10 changes: 10 additions & 0 deletions src/Ombi.Core/Models/Requests/FilterResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Collections.Generic;

namespace Ombi.Core.Models.Requests
{
public class FilterResult<T>
{
public int Total { get; set; }
public IEnumerable<T> Collection { get; set; }
}
}
2 changes: 2 additions & 0 deletions src/Ombi.Core/Models/Requests/FilterViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class FilterViewModel
{
public FilterType AvailabilityFilter { get; set; }
public FilterType StatusFilter { get; set; }
public int Position { get; set; }
public int Count { get; set; }
}

public enum FilterType
Expand Down
1 change: 1 addition & 0 deletions src/Ombi.DependencyInjection/IocExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public static void RegisterJobs(this IServiceCollection services)
services.AddTransient<ISickRageSync, SickRageSync>();
services.AddTransient<IRefreshMetadata, RefreshMetadata>();
services.AddTransient<INewsletterJob, NewsletterJob>();
services.AddTransient<IPlexRecentlyAddedSync, PlexRecentlyAddedSync>();
}
}
}
2 changes: 1 addition & 1 deletion src/Ombi.Mapping/Profiles/MovieProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public MovieProfile()
.ForMember(x => x.ReleaseDate, o => o.MapFrom(s => s.release_date))
.ForMember(x => x.Type, o => o.MapFrom(s => s.Type));

CreateMap<Genre, GenreDto>();
CreateMap<TheMovieDbApi.Models.Genre, GenreDto>();

CreateMap<MovieSearchResult, SearchMovieViewModel>().ReverseMap();
CreateMap<MovieResponseDto, SearchMovieViewModel>().ReverseMap();
Expand Down
2 changes: 1 addition & 1 deletion src/Ombi.Notifications.Templates/TemplateBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public abstract class TemplateBase
{
public abstract string TemplateLocation { get; }
public virtual string OmbiLogo => "http://i.imgur.com/qQsN78U.png";
public virtual string OmbiLogo => "http://i.imgur.com/7pqVq7W.png";
}
}
Loading

0 comments on commit 6391988

Please sign in to comment.