Skip to content

Commit

Permalink
Merge pull request #4 from TheUltimateC0der/develop
Browse files Browse the repository at this point in the history
SonarrV4 compatibility
  • Loading branch information
TheUltimateC0der committed Apr 20, 2023
2 parents b6fbfb3 + 406353e commit 2066884
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
@@ -0,0 +1,2 @@
github: TheUltimateC0der
patreon: listrrpro
48 changes: 48 additions & 0 deletions .github/workflows/docker-publish.yml
@@ -0,0 +1,48 @@
name: Docker Image CI
on:
push:
branches: [ "develop", "master" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "develop" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
# github.ref as branch
BRANCH: ${{ github.ref_name }}


jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: set lower case owner name
run: |
echo "IMAGE_NAME_LC=${IMAGE_NAME,,}" >>${GITHUB_ENV}
env:
IMAGE_NAME: ${{ github.repository }}

- name: Build the Docker image
if: github.event_name != 'pull_request'
run: docker build . --file Dockerfile -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:$(date +%s) -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:latest -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}:${{ env.BRANCH }} --label "org.opencontainers.image.source=https://github.com/TheUltimateC0der/alternatrr" --label "org.opencontainers.image.description=alternatrr lets you add alternative titles to your sonarr instance by editing the sonarr.db file directly via a simple UI." --label "org.opencontainers.image.licenses=AGPL3"

- name: Docker Login
if: github.event_name != 'pull_request'
uses: docker/login-action@v1.14.1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push docker image
run: docker push -a ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }}
4 changes: 2 additions & 2 deletions Dockerfile
@@ -1,8 +1,8 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim AS build
WORKDIR /src
COPY ["alternatrr/alternatrr.csproj", "alternatrr/"]
RUN dotnet restore "alternatrr/alternatrr.csproj"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -8,10 +8,10 @@ alternatrr lets you add alternative titles to your sonarr instance by editing th
version: '3'
services:
alternatrr:
image: theultimatecoder/alternatrr:latest
image: ghcr.io/theultimatecoder/alternatrr:latest
environment:
- ConnectionStrings__DefaultConnection=Data Source=/opt/alternatrr/app/alternatrr.db
- ConnectionStrings__sonarr=Data Source=/opt/sonarr/app/sonarr.db
- ConnectionStrings__sonarr=Data Source=/opt/sonarr/sonarr.db
- Login__Username=Test
- Login__Password=ChangeMe321!
# Needed for reverseproxy
Expand All @@ -20,6 +20,6 @@ services:
- LETSENCRYPT_HOST=alternatrr.YOURDOMAIN.COM
- LETSENCRYPT_EMAIL=YOUREMAILADDRESS
volumes:
- /opt/sonarr/app:/opt/sonarr/app #Mounting the directory with sonarr.db in it
- /opt/sonarr:/opt/sonarr #Mounting the directory with sonarr.db in it
- /opt/alternatrr/app:/opt/alternatrr/app #Mounting the alternatrr.db peristent login
```
6 changes: 1 addition & 5 deletions alternatrr/Data/Sonarr/Series.cs
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;

#nullable disable
#nullable disable

namespace alternatrr
{
Expand Down Expand Up @@ -41,6 +38,5 @@ public partial class Series
public byte[] Added { get; set; }
public string AddOptions { get; set; }
public long TvMazeId { get; set; }
public long LanguageProfileId { get; set; }
}
}
19 changes: 10 additions & 9 deletions alternatrr/Migrations/AppDbContextModelSnapshot.cs
Expand Up @@ -5,6 +5,8 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using alternatrr.Data;

#nullable disable

namespace alternatrr.Migrations
{
[DbContext(typeof(AppDbContext))]
Expand All @@ -13,8 +15,7 @@ partial class AppDbContextModelSnapshot : ModelSnapshot
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.2");
modelBuilder.HasAnnotation("ProductVersion", "7.0.5");

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
Expand All @@ -39,7 +40,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles");
b.ToTable("AspNetRoles", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
Expand All @@ -62,7 +63,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
b.ToTable("AspNetRoleClaims", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
Expand Down Expand Up @@ -126,7 +127,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers");
b.ToTable("AspNetUsers", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
Expand All @@ -149,7 +150,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims");
b.ToTable("AspNetUserClaims", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
Expand All @@ -173,7 +174,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins");
b.ToTable("AspNetUserLogins", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
Expand All @@ -188,7 +189,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles");
b.ToTable("AspNetUserRoles", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
Expand All @@ -209,7 +210,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens");
b.ToTable("AspNetUserTokens", (string)null);
});

modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
Expand Down
7 changes: 0 additions & 7 deletions alternatrr/Program.cs
@@ -1,12 +1,5 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace alternatrr
{
Expand Down
22 changes: 13 additions & 9 deletions alternatrr/Properties/launchSettings.json
@@ -1,12 +1,4 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:12146",
"sslPort": 44381
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
Expand All @@ -20,7 +12,11 @@
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation",
"ConnectionStrings__DefaultConnection": "Data Source=D:\\Software\\Sonarr\\alternatrr.db",
"ConnectionStrings__sonarr": "Data Source=C:\\ProgramData\\Sonarr\\sonarr.db",
"Login__Username": "Test",
"Login__Password": "ChangeMe321!"
},
"dotnetRunMessages": "true",
"applicationUrl": "https://localhost:5001;http://localhost:5000"
Expand All @@ -32,5 +28,13 @@
"publishAllPorts": true,
"useSSL": true
}
},
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:12146",
"sslPort": 44381
}
}
}
25 changes: 14 additions & 11 deletions alternatrr/alternatrr.csproj
@@ -1,26 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<UserSecretsId>aspnet-alternatrr-E5938721-38F8-4F42-AAAA-AF92C2908E4D</UserSecretsId>
<CopyRefAssembliesToPublishDirectory>false</CopyRefAssembliesToPublishDirectory>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.2">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.18.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.6" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 2066884

Please sign in to comment.