Merge branch 'develop' of https://github.com/ombi-app/Ombi into develop

pull/4235/head v4.0.1421
tidusjar 3 years ago
commit 043eb08aa5

@ -27,9 +27,12 @@ namespace Ombi.Core.Rule.Rules.Search
var useTheMovieDb = false;
var useId = false;
var useTvDb = false;
PlexMediaTypeEntity type = ConvertType(obj.Type);
if (obj.ImdbId.HasValue())
{
item = await PlexContentRepository.Get(obj.ImdbId, ProviderType.ImdbId);
item = await PlexContentRepository.GetByType(obj.ImdbId, ProviderType.ImdbId, type);
if (item != null)
{
useImdb = true;
@ -39,7 +42,7 @@ namespace Ombi.Core.Rule.Rules.Search
{
if (obj.Id > 0)
{
item = await PlexContentRepository.Get(obj.Id.ToString(), ProviderType.TheMovieDbId);
item = await PlexContentRepository.GetByType(obj.Id.ToString(), ProviderType.TheMovieDbId, type);
if (item != null)
{
useId = true;
@ -47,7 +50,7 @@ namespace Ombi.Core.Rule.Rules.Search
}
if (obj.TheMovieDbId.HasValue())
{
item = await PlexContentRepository.Get(obj.TheMovieDbId, ProviderType.TheMovieDbId);
item = await PlexContentRepository.GetByType(obj.TheMovieDbId, ProviderType.TheMovieDbId, type);
if (item != null)
{
useTheMovieDb = true;
@ -58,7 +61,7 @@ namespace Ombi.Core.Rule.Rules.Search
{
if (obj.TheTvDbId.HasValue())
{
item = await PlexContentRepository.Get(obj.TheTvDbId, ProviderType.TvDbId);
item = await PlexContentRepository.GetByType(obj.TheTvDbId, ProviderType.TvDbId, type);
if (item != null)
{
useTvDb = true;
@ -100,6 +103,12 @@ namespace Ombi.Core.Rule.Rules.Search
return Success();
}
private PlexMediaTypeEntity ConvertType(RequestType type) =>
type switch
{
RequestType.Movie => PlexMediaTypeEntity.Movie,
RequestType.TvShow => PlexMediaTypeEntity.Show,
_ => PlexMediaTypeEntity.Movie,
};
}
}

@ -107,7 +107,7 @@ namespace Ombi.Helpers
public static string GetPlexMediaUrl(string machineId, int mediaId)
{
var url =
$"https://app.plex.tv/web/app#!/server/{machineId}/details?key=library%2Fmetadata%2F{mediaId}";
$"https://app.plex.tv/web/app#!/server/{machineId}/details?key=%2flibrary%2Fmetadata%2F{mediaId}";
return url;
}

@ -12,6 +12,7 @@ namespace Ombi.Store.Repository
{
Task<bool> ContentExists(string providerId);
Task<PlexServerContent> Get(string providerId, ProviderType type);
Task<PlexServerContent> GetByType(string providerId, ProviderType type, PlexMediaTypeEntity plexType);
Task<PlexServerContent> GetByKey(int key);
Task Update(PlexServerContent existingContent);
IQueryable<PlexEpisode> GetAllEpisodes();

@ -79,6 +79,23 @@ namespace Ombi.Store.Repository
return null;
}
public async Task<PlexServerContent> GetByType(string providerId, ProviderType type, PlexMediaTypeEntity plexType)
{
switch (type)
{
case ProviderType.ImdbId:
return await Db.PlexServerContent.FirstOrDefaultAsync(x => x.ImdbId == providerId && x.Type == plexType);
case ProviderType.TheMovieDbId:
return await Db.PlexServerContent.FirstOrDefaultAsync(x => x.TheMovieDbId == providerId && x.Type == plexType);
case ProviderType.TvDbId:
return await Db.PlexServerContent.FirstOrDefaultAsync(x => x.TvDbId == providerId && x.Type == plexType);
default:
break;
}
return null;
}
public async Task<PlexServerContent> GetByKey(int key)
{
return await Db.PlexServerContent.Include(x => x.Seasons).FirstOrDefaultAsync(x => x.Key == key);

@ -103,4 +103,10 @@
.card-skeleton {
padding: 5px;
}
@media (min-width:755px){
::ng-deep .p-carousel-item{
flex: 1 0 200px !important;
}
}

@ -46,80 +46,80 @@ export class CarouselListComponent implements OnInit {
{
breakpoint: '4000px',
numVisible: 17,
numScroll: 17
numScroll: 16
},
{
breakpoint: '3800px',
numVisible: 16,
numScroll: 16
numScroll: 15
},
{
breakpoint: '3600px',
numVisible: 15,
numScroll: 15
numScroll: 14
},
{
breakpoint: '3400px',
numVisible: 14,
numScroll: 14
numScroll: 13
},
{
breakpoint: '3200px',
numVisible: 13,
numScroll: 13
numScroll: 12
},
{
breakpoint: '3000px',
numVisible: 12,
numScroll: 12
numScroll: 11
},
{
breakpoint: '2800px',
numVisible: 11,
numScroll: 11
numScroll: 10
},
{
breakpoint: '2600px',
numVisible: 10,
numScroll: 10
numScroll: 9
},
{
breakpoint: '2400px',
numVisible: 9,
numScroll: 9
numScroll: 8
},
{
breakpoint: '2200px',
numVisible: 8,
numScroll: 8
numScroll: 7
},
{
breakpoint: '2000px',
numVisible: 7,
numScroll: 7
numScroll: 6
},
{
breakpoint: '1800px',
numVisible: 6,
numScroll: 6
numScroll: 5
},
{
breakpoint: '1650px',
numVisible: 5,
numScroll: 5
numScroll: 4
},
{
breakpoint: '1500px',
numVisible: 4,
numScroll: 4
numScroll: 3
},
{
breakpoint: '1250px',
breakpoint: '768px',
numVisible: 3,
numScroll: 3
numScroll: 2
},
{
breakpoint: '768px',
breakpoint: '660px',
numVisible: 2,
numScroll: 2
},

@ -9,9 +9,4 @@ h2{
margin-top:40px;
margin-left:40px;
font-size: 24px;
}
::ng-deep .p-carousel-item{
min-height:290px;
max-height:290px;
}

@ -49,7 +49,7 @@
{{'Search.ViewOnEmby' | translate}}
<i class="far fa-play-circle fa-2x"></i>
</a>
<a id="viewOnJellyfinButton" *ngIf="movie.jellyfinUrl" href="{{movie.jellyfinUrl}}" mat-raised-button target="_blank" class="btn-spacing viewon-btn jellyfinUrl">
<a id="viewOnJellyfinButton" *ngIf="movie.jellyfinUrl" href="{{movie.jellyfinUrl}}" mat-raised-button target="_blank" class="btn-spacing viewon-btn jellyfin">
{{'Search.ViewOnJellyfin' | translate}}
<i class="far fa-play-circle fa-2x"></i>
</a>

@ -124,8 +124,14 @@
}
}
.profile-img{
display: flex;
justify-content: center;
align-self: center;
}
.profile-img img {
width: 50px;
width: 40px;
}
@ -154,9 +160,10 @@
font-size:36px;
padding:40px 20px;
height:auto;
max-width: 350px;
max-width: 300px;
display: flex;
white-space: normal;
word-break: break-word;
}
.outer-profile {
@ -171,7 +178,6 @@
font-weight: 400;
padding:10px 20px;
height:auto;
width:20rem;
margin-bottom:0.5rem;
}
@ -181,7 +187,6 @@
border-radius:0px 30px 30px 0px;
padding:10px 20px;
height:auto;
width:20rem;
}
}
@ -220,4 +225,9 @@
::ng-deep .mat-toolbar-row, .mat-toolbar-single-row{
height:auto;
}
::ng-deep .mat-sidenav-fixed .mat-list-base .mat-list-item .mat-list-item-content, .mat-list-base .mat-list-option .mat-list-item-content{
padding:0;
margin: 0 4em 0 0.5em;
}

@ -141,4 +141,5 @@ table {
.icon-spacing {
margin-right: 1%;
}
}

@ -54,7 +54,7 @@
"Discover": "Discover",
"Search": "Search",
"Requests": "Requests",
"UserManagement": "User Management",
"UserManagement": "Users",
"Issues": "Issues",
"Vote": "Vote",
"Donate": "Donate!",
@ -70,7 +70,7 @@
"ChangeTheme": "Change Theme",
"Calendar": "Calendar",
"UserPreferences": "Preferences",
"FeatureSuggestion":"Feature Suggestion",
"FeatureSuggestion":"Features",
"FeatureSuggestionTooltip":"Have a great new idea? Suggest it here!",
"Filter": {
"Movies":"Movies",

@ -102,7 +102,7 @@ describe("Movie Details Buttons", () => {
Page.availableButton.should("exist");
});
it("Movie Requested, Deny Movie", () => {
it.skip("Movie Requested, Deny Movie", () => {
cy.login();
Page.visit("671");

@ -15,7 +15,7 @@ describe("Search Tests", () => {
card.topLevelCard.realHover();
card.title.should('have.text', "Dexter's Laboratory");
card.overview.contains('Cartoon Network');
card.overview.contains('Dexter');
card.requestType.contains('TV Show');
card.requestButton.should('exist');
});

@ -16,7 +16,7 @@ describe('User Management Page', () => {
});
it('Loads users table', () => {
cy.contains("User Management");
cy.contains("Users");
cy.contains("Add User To Ombi");
});

Loading…
Cancel
Save