├── .gitignore ├── BuildScripts ├── Dockerfile ├── build.sh ├── dotnetbuild.sh ├── jprm_build.sh └── package.sh ├── CHANGELOG.md ├── Directory.Build.props ├── Jellyfin.Plugin.Newsletters.sln ├── Jellyfin.Plugin.Newsletters ├── Configuration │ ├── PluginConfiguration.cs │ ├── configPage.html │ └── configPage.html.bak ├── Emails │ ├── HTMLBuilder.cs │ └── smtp.cs ├── Jellyfin.Plugin.Newsletters.csproj ├── Logger.cs ├── Plugin.cs ├── Scanner │ ├── PosterImageHandler.cs │ └── Scraper.cs ├── ScheduledTasks │ ├── EmailNewsletterTask.cs │ └── ScanLibraryTask.cs ├── Shared │ ├── Database │ │ └── SQLiteDatabase.cs │ └── Entities │ │ ├── JsonFileObj.cs │ │ └── NlDetailsJson.cs ├── Templates │ ├── templateBody.html │ ├── templateBodyFull.html.bak │ ├── templateBodyWithEntries.html │ ├── templateEntry.html │ ├── template_modern_body.html │ ├── template_modern_entry.html │ └── template_modern_full.html └── manifest.json ├── LICENSE ├── NewsletterExample.png ├── README.md ├── build.yaml ├── jellyfin.ruleset ├── logo.png └── manifest.json /.gitignore: -------------------------------------------------------------------------------- 1 | */.DS_Store 2 | Jellyfin.Plugin.Newsletters/bin 3 | Jellyfin.Plugin.Newsletters/obj 4 | RELEASES 5 | artifacts 6 | Jellyfin.Plugin.Newsletters/newsletters/ 7 | *.bak -------------------------------------------------------------------------------- /BuildScripts/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG IMAGE_TAG=8 2 | FROM mcr.microsoft.com/dotnet/sdk:${IMAGE_TAG}.0 3 | 4 | RUN apt-get update -y && \ 5 | apt-get install python3 python3.11-venv zip unzip -y && \ 6 | python3 -m venv venv && \ 7 | . venv/bin/activate && \ 8 | pip install jprm 9 | 10 | RUN mkdir /.dotnet /.nuget /.local && chown 1000:1000 /.dotnet /.nuget /.local 11 | 12 | USER 1000:1000 -------------------------------------------------------------------------------- /BuildScripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | TAG=${1} 3 | 4 | #### V1 #### 5 | 6 | # if ! docker images -a | grep mcr.microsoft.com/dotnet/sdk${TAG}.0; then 7 | # echo "Pulling dotnet:${TAG}.0 image" 8 | # docker pull mcr.microsoft.com/dotnet/sdk:${TAG}.0 9 | # else 10 | # echo "Image already exists!" 11 | # fi 12 | 13 | # docker run --name dotnet -it -v .:/Development mcr.microsoft.com/dotnet/sdk:${TAG}.0 /Development/BuildScripts/dotnetbuild.sh 14 | # docker rm dotnet 15 | 16 | #### V2 #### 17 | IMAGE="pypi_dotnet" 18 | echo "Using image: '${IMAGE}:${TAG}.0'" 19 | if ! docker images -a | grep "${IMAGE}" | grep "${TAG}.0"; then 20 | echo "Generating '${IMAGE}:${TAG}.0' image" 21 | docker build -t ${IMAGE}:${TAG}.0 --build-arg IMAGE_TAG=8 ./BuildScripts/ 22 | else 23 | echo "Image already exists!" 24 | fi 25 | 26 | docker run --name dotnet -it -v .:/Development ${IMAGE}:${TAG}.0 /Development/BuildScripts/dotnetbuild.sh "${2}" 27 | docker rm dotnet 28 | 29 | # docker build -t pypi_dotnet:8.0 --build-arg IMAGE_TAG=8 . -------------------------------------------------------------------------------- /BuildScripts/dotnetbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | . venv/bin/activate 3 | cd /Development 4 | # dotnet build 5 | # dotnet publish 6 | 7 | if [[ "${1}" == "prod" ]]; then 8 | export JELLYFIN_REPO="./Jellyfin.Plugin.Newsletters" 9 | export JELLYFIN_REPO_URL="https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download" 10 | ./BuildScripts/jprm_build.sh 11 | cp ./Jellyfin.Plugin.Newsletters/manifest.json ./manifest.json 12 | else 13 | dotnet build 14 | # dotnet publish 15 | fi 16 | exit $? -------------------------------------------------------------------------------- /BuildScripts/jprm_build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) 2020 - Odd Strabo 4 | # 5 | # 6 | # The Unlicense 7 | # ============= 8 | # 9 | # This is free and unencumbered software released into the public domain. 10 | # 11 | # Anyone is free to copy, modify, publish, use, compile, sell, or 12 | # distribute this software, either in source code form or as a compiled 13 | # binary, for any purpose, commercial or non-commercial, and by any 14 | # means. 15 | # 16 | # In jurisdictions that recognize copyright laws, the author or authors 17 | # of this software dedicate any and all copyright interest in the 18 | # software to the public domain. We make this dedication for the benefit 19 | # of the public at large and to the detriment of our heirs and 20 | # successors. We intend this dedication to be an overt act of 21 | # relinquishment in perpetuity of all present and future rights to this 22 | # software under copyright law. 23 | # 24 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 | # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 28 | # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 29 | # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 | # OTHER DEALINGS IN THE SOFTWARE. 31 | # 32 | # For more information, please refer to 33 | # 34 | 35 | MY=$(dirname $(realpath -s "${0}")) 36 | JPRM="jprm" 37 | 38 | DEFAULT_REPO_DIR="${MY}/test_repo" 39 | DEFAULT_REPO_URL="http://localhost:8080" 40 | 41 | PLUGIN=${1:-${PLUGIN:-.}} 42 | 43 | ARTIFACT_DIR=${ARTIFACT_DIR:-"${MY}/artifacts"} 44 | mkdir -p "${ARTIFACT_DIR}" 45 | 46 | JELLYFIN_REPO=${JELLYFIN_REPO:-${DEFAULT_REPO_DIR}} 47 | JELLYFIN_REPO_URL=${JELLYFIN_REPO_URL:-${DEFAULT_REPO_URL}} 48 | 49 | # Each segment of the version is a 16bit number. 50 | # Max number is 65535. 51 | VERSION_SUFFIX=${VERSION_SUFFIX:-$(date -u +%y%m.%d%H.%M%S)} 52 | 53 | meta_version=$(grep -Po '^ *version: * "*\K[^"$]+' "${PLUGIN}/build.yaml") 54 | VERSION=${VERSION:-$(echo $meta_version)} 55 | 56 | # !!! VERSION IS OVERWRITTEN HERE 57 | #VERSION="${meta_version}" 58 | 59 | find "${PLUGIN}" -name project.assets.json -exec rm -v '{}' ';' 60 | 61 | zipfile=$($JPRM --verbosity=debug plugin build "${PLUGIN}" --output="${ARTIFACT_DIR}" --version="${VERSION}") && { 62 | $JPRM --verbosity=debug repo add --url=${JELLYFIN_REPO_URL} "${JELLYFIN_REPO}" "${zipfile}" 63 | } 64 | rc=$? 65 | 66 | # echo $JELLYFIN_REPO 67 | # package Templates/ as well 68 | cd ${MY}/../${JELLYFIN_REPO} 69 | zipfile="./newsletters/newsletters_${VERSION}.zip" 70 | zip -r ${zipfile} ./Templates 71 | echo "----------" 72 | echo "Contents in ${zipfile}" 73 | unzip -l ${zipfile} 74 | sed -i "s/github.com\/Cloud9Developer\/Jellyfin-Newsletter-Plugin\/releases\/download\/newsletters/github.com\/Cloud9Developer\/Jellyfin-Newsletter-Plugin\/releases\/download\/v${VERSION}/g" manifest.json 75 | md5sum ${zipfile} 76 | exit $rc -------------------------------------------------------------------------------- /BuildScripts/package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | dir="RELEASES" 3 | if [ ! -d "${dir}" ]; then 4 | mkdir ${dir} 5 | fi 6 | 7 | read -p "VERSION: " ver 8 | 9 | zip -j ${dir}/Newsletters-v${ver}.zip \ 10 | Jellyfin.Plugin.Newsletters/bin/Release/net8.0/Jellyfin.Plugin.Newsletters.dll \ 11 | Jellyfin.Plugin.Newsletters/bin/Release/net8.0/publish/SQLitePCL.pretty.dll 12 | 13 | echo '---' 14 | 15 | echo "CHECKSUM: `md5sum ${dir}/Newsletters-v${ver}.zip`" -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.6.4.0 2 | - Minor bug fix 3 | 4 | # 0.6.3.0 5 | - Major code refactoring. 6 | - Added additional data tags (see README.md) 7 | - Database updates for new available Tags. 8 | - Catch all for any missed tags in newsletter output. 9 | - Alert for "Test mail" button. 10 | - Better error logging/handling. 11 | - Added template files to Plugin directory 12 | - Plugin now pulls from these files as default values instead of hardcoded values in codebase 13 | 14 | # 0.6.2.1 15 | - Minor security fix 16 | - Cleaned codebase for easier readability 17 | - Minor refactor 18 | 19 | # 0.6.2.0 20 | - Updated support for the latest Jellyfin Server release (10.9.0) 21 | - Fixed Scheduled Scan task completion meter. Now accurately gives percentage of completion. 22 | - Added {Date} to allow for autogenerated dates to be added to HTML body 23 | - ***More updates on the way, finally have a little down time. Thank you for all the support!*** 24 | 25 | # 0.6.0 26 | - Added ability to use custom HTML for newsletter emails 27 | - Added buildscript (using dotnet docker) for easier development 28 | 29 | # 0.5.1 30 | - Cleaned up logging for easier readibility 31 | 32 | # 0.5.0 33 | - Added JF Poster Serving Functionality 34 | - Allows users to set HOSTNAME/URL to their JF server to serve poster images directly from JF, bypassing any limitations on 3rd parties such as Imgur 35 | - Plugin config page optimization/cleanup 36 | 37 | # 0.4.0 38 | - Added movie Functionality 39 | 40 | # 0.3.3 41 | - Added Test Mail button (tsfoni) 42 | - Fixed issue where sometimes episode list would cause error due to empty list 43 | 44 | # 0.3.2 45 | - Fixed/cleaned newsletter episode formatting/counting and ranges 46 | - Re-org of some logic to catch more errors 47 | - This will allow scan to continue even after error occurs instead of halting the scan 48 | - Updated Logo 49 | - Updated Template HTML to match what is currently being used 50 | - Cleanup 51 | 52 | # 0.3.1 53 | - Fixed/cleaned newsletter episode formatting/counting and ranges 54 | - Updated Logo 55 | - Updated Template HTML to match what is currently being used 56 | - Cleanup 57 | 58 | # 0.3.0 59 | - Major overhaul to backend data processing 60 | - Now implementing SQLite services instead of TXT formatting. 61 | - ***This will affect current users! Scans prior to this release will not be imported over. I apologize for this inconvenience*** 62 | - Added a catch to Imgur's upload limit. 63 | - Processing will now stop when limit is reached, and resume on the next scan 64 | - Progress bar functionality is now operational in Scheduled Tasks 65 | - Code cleanup 66 | - Merged cleanup/readability submitted by **tsfoni** 67 | 68 | # 0.0.5 69 | - Major overhaul to backend file processing 70 | - Removed requirement/limitation on google image search API 71 | - Now pulling posters from Jellyfin Server 72 | - Now pulling episode list from Jellyfin server rather than manually discovering files in filesystem 73 | - This will allow future improvements, such as Movie scanning 74 | 75 | # 0.0.1 76 | - Initial Alpha Release 77 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.6.4.2 4 | 0.6.4.2 5 | 0.6.4.2 6 | 7 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Plugin.Newsletters", "Jellyfin.Plugin.Newsletters\Jellyfin.Plugin.Newsletters.csproj", "{D921B930-CF91-406F-ACBC-08914DCD0D34}" 3 | EndProject 4 | Global 5 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 6 | Debug|Any CPU = Debug|Any CPU 7 | Release|Any CPU = Release|Any CPU 8 | EndGlobalSection 9 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 10 | {D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 11 | {D921B930-CF91-406F-ACBC-08914DCD0D34}.Debug|Any CPU.Build.0 = Debug|Any CPU 12 | {D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|Any CPU.ActiveCfg = Release|Any CPU 13 | {D921B930-CF91-406F-ACBC-08914DCD0D34}.Release|Any CPU.Build.0 = Release|Any CPU 14 | EndGlobalSection 15 | EndGlobal 16 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Configuration/PluginConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using MediaBrowser.Model.Plugins; 4 | 5 | namespace Jellyfin.Plugin.Newsletters.Configuration; 6 | 7 | /// 8 | /// Plugin configuration. 9 | /// 10 | public class PluginConfiguration : BasePluginConfiguration 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | public PluginConfiguration() 16 | { 17 | Console.WriteLine("[NLP] :: Newsletter Plugin Starting.."); 18 | 19 | // set default options here 20 | DebugMode = false; 21 | 22 | // default Server Details 23 | SMTPServer = "smtp.gmail.com"; 24 | SMTPPort = 587; 25 | SMTPUser = string.Empty; 26 | SMTPPass = string.Empty; 27 | 28 | // default Email Details 29 | ToAddr = string.Empty; 30 | FromAddr = "JellyfinNewsletter@donotreply.com"; 31 | Subject = "Jellyfin Newsletter"; 32 | 33 | // Attempt Dynamic set of Body and Entry HTML, set empty if failure occurs 34 | Body = string.Empty; 35 | Entry = string.Empty; 36 | 37 | try 38 | { 39 | string[] dirs = Directory.GetDirectories(@".", "config/plugins/Newsletters_*.*.*.*", SearchOption.AllDirectories); 40 | string pluginDir = string.Empty; 41 | if (dirs.Length > 1) 42 | { 43 | Console.WriteLine($"[NLP] :: Found {dirs.Length} matches for plugin directory..."); 44 | } 45 | else 46 | { 47 | foreach (string dir in dirs) 48 | { 49 | Console.WriteLine("[NLP] :: Plugin Directory is: {0}", dir); 50 | pluginDir = dir; 51 | break; 52 | } 53 | } 54 | 55 | try 56 | { 57 | Body = File.ReadAllText($"{pluginDir}/Templates/template_modern_body.html"); 58 | Console.WriteLine("[NLP] :: Body HTML set from Template file!"); 59 | } 60 | catch (Exception ex) 61 | { 62 | Console.WriteLine("[NLP] :: Failed to set default Body HTML from Template file"); 63 | Console.WriteLine(ex); 64 | } 65 | 66 | try 67 | { 68 | Entry = File.ReadAllText($"{pluginDir}/Templates/template_modern_entry.html"); 69 | Console.WriteLine("[NLP] :: Entry HTML set from Template file!"); 70 | } 71 | catch (Exception ex) 72 | { 73 | Console.WriteLine("[NLP] :: Failed to set default Entry HTML from Template file"); 74 | Console.WriteLine(ex); 75 | } 76 | } 77 | catch (Exception e) 78 | { 79 | Console.WriteLine("[NLP] :: [ERR] Failed to locate/set html body from template file.."); 80 | Console.WriteLine(e); 81 | } 82 | 83 | // default Scraper config 84 | ApiKey = string.Empty; 85 | 86 | // System Paths 87 | DataPath = string.Empty; 88 | TempDirectory = string.Empty; 89 | PluginsPath = string.Empty; 90 | ProgramDataPath = string.Empty; 91 | SystemConfigurationFilePath = string.Empty; 92 | ProgramSystemPath = string.Empty; 93 | LogDirectoryPath = string.Empty; 94 | 95 | // default newsletter paths 96 | NewsletterFileName = string.Empty; 97 | NewsletterDir = string.Empty; 98 | 99 | // default libraries 100 | MoviesEnabled = true; 101 | SeriesEnabled = true; 102 | 103 | // poster hosting 104 | PHType = "Imgur"; 105 | Hostname = string.Empty; 106 | } 107 | 108 | /// 109 | /// Gets or sets a value indicating whether debug mode is enabled.. 110 | /// 111 | public bool DebugMode { get; set; } 112 | 113 | // Server Details 114 | 115 | /// 116 | /// Gets or sets a value indicating whether some true or false setting is enabled.. 117 | /// 118 | public string SMTPServer { get; set; } 119 | 120 | /// 121 | /// Gets or sets an integer setting. 122 | /// 123 | public int SMTPPort { get; set; } 124 | 125 | /// 126 | /// Gets or sets a string setting. 127 | /// 128 | public string SMTPUser { get; set; } 129 | 130 | /// 131 | /// Gets or sets a string setting. 132 | /// 133 | public string SMTPPass { get; set; } 134 | 135 | // ----------------------------------- 136 | 137 | // Email Details 138 | 139 | /// 140 | /// Gets or sets a string setting. 141 | /// 142 | public string ToAddr { get; set; } 143 | 144 | /// 145 | /// Gets or sets a string setting. 146 | /// 147 | public string FromAddr { get; set; } 148 | 149 | /// 150 | /// Gets or sets a string setting. 151 | /// 152 | public string Subject { get; set; } 153 | 154 | /// 155 | /// Gets or sets a string setting. 156 | /// 157 | public string Body { get; set; } 158 | 159 | /// 160 | /// Gets or sets a string setting. 161 | /// 162 | public string Entry { get; set; } 163 | 164 | // ----------------------------------- 165 | 166 | // Scraper Config 167 | 168 | /// 169 | /// Gets or sets a value indicating hosting type. 170 | /// 171 | public string PHType { get; set; } 172 | 173 | /// 174 | /// Gets or sets a value for JF hostname accessible outside of network. 175 | /// 176 | public string Hostname { get; set; } 177 | 178 | /// 179 | /// Gets or sets a string setting. 180 | /// 181 | public string ApiKey { get; set; } 182 | 183 | // ----------------------------------- 184 | 185 | // System Paths 186 | 187 | /// 188 | /// Gets or sets a string setting. 189 | /// 190 | public string PluginsPath { get; set; } 191 | 192 | /// 193 | /// Gets or sets a string setting. 194 | /// 195 | public string TempDirectory { get; set; } 196 | 197 | /// 198 | /// Gets or sets a string setting. 199 | /// 200 | public string DataPath { get; set; } 201 | 202 | /// 203 | /// Gets or sets a string setting. 204 | /// 205 | public string ProgramDataPath { get; set; } 206 | 207 | /// 208 | /// Gets or sets a string setting. 209 | /// 210 | public string SystemConfigurationFilePath { get; set; } 211 | 212 | /// 213 | /// Gets or sets a string setting. 214 | /// 215 | public string ProgramSystemPath { get; set; } 216 | 217 | /// 218 | /// Gets or sets a string setting. 219 | /// 220 | public string LogDirectoryPath { get; set; } 221 | 222 | // ----------------------------------- 223 | 224 | // Newsletter Paths 225 | 226 | /// 227 | /// Gets or sets a string setting. 228 | /// 229 | public string NewsletterFileName { get; set; } 230 | 231 | /// 232 | /// Gets or sets a string setting. 233 | /// 234 | public string NewsletterDir { get; set; } 235 | 236 | /// 237 | /// Gets or sets a value indicating whether Series should be scanned. 238 | /// 239 | public bool SeriesEnabled { get; set; } 240 | 241 | /// 242 | /// Gets or sets a value indicating whether Movies should be scanned. 243 | /// 244 | public bool MoviesEnabled { get; set; } 245 | } 246 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Configuration/configPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Newsletters 6 | 7 | 8 |
9 |
10 |
11 |
12 |
13 | 17 |
18 |
19 |
20 | 21 | 22 |
Recipient's email to recieve newsletter. If more than 1, seperate with commas
23 |
24 |
25 | 26 | 27 |
The address that the newsletter will come from
28 |
29 |
30 | 31 | 32 |
Subject field of the newsletter (Default: 'Jellyfin Newsletter)
33 |
34 |
35 |
36 | 37 | 38 | 39 | 47 | 55 | 56 |
Types of items to scan:
40 |
41 | 45 |
46 |
48 |
49 | 53 |
54 |
57 |
58 | 59 | 60 | 61 | 62 | 90 |
91 | 92 | 93 | 124 | 125 |
126 | 127 | 155 | 156 |
157 | 160 |
161 |
162 |
163 |
164 | 181 | 305 |
306 | 307 | 308 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Configuration/configPage.html.bak: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Template 6 | 7 | 8 |
9 |
10 |
11 |
12 |
13 | 14 | 18 |
19 |
20 | 21 | 22 |
A Description
23 |
24 |
25 | 29 |
30 |
31 | 32 | 33 |
Another Description
34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 | 77 |
78 | 79 | 80 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Emails/HTMLBuilder.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591, SYSLIB0014, CA1002, CS0162, SA1005 // remove SA1005 for cleanup 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Concurrent; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Net; 9 | using System.Net.Http; 10 | using System.Threading; 11 | using System.Threading.Tasks; 12 | using Jellyfin.Plugin.Newsletters.Configuration; 13 | using Jellyfin.Plugin.Newsletters.LOGGER; 14 | using Jellyfin.Plugin.Newsletters.Scripts.ENTITIES; 15 | using Jellyfin.Plugin.Newsletters.Scripts.SCRAPER; 16 | using Jellyfin.Plugin.Newsletters.Shared.DATA; 17 | using MediaBrowser.Common.Configuration; 18 | using MediaBrowser.Common.Plugins; 19 | using MediaBrowser.Controller; 20 | using MediaBrowser.Controller.Entities; 21 | using MediaBrowser.Controller.Library; 22 | using MediaBrowser.Model.Tasks; 23 | using Newtonsoft.Json; 24 | using Newtonsoft.Json.Linq; 25 | // using Microsoft.Extensions.Logging; 26 | 27 | namespace Jellyfin.Plugin.Newsletters.Emails.HTMLBuilder; 28 | 29 | public class HtmlBuilder 30 | { 31 | // Global Vars 32 | // Readonly 33 | private readonly PluginConfiguration config; 34 | private readonly string newslettersDir; 35 | private readonly string newsletterHTMLFile; 36 | // private readonly string[] itemJsonKeys = 37 | 38 | private string emailBody; 39 | private Logger logger; 40 | private SQLiteDatabase db; 41 | private JsonFileObj jsonHelper; 42 | 43 | // Non-readonly 44 | private static string append = "Append"; 45 | private static string write = "Overwrite"; 46 | // private List fileList; 47 | 48 | public HtmlBuilder() 49 | { 50 | logger = new Logger(); 51 | jsonHelper = new JsonFileObj(); 52 | db = new SQLiteDatabase(); 53 | config = Plugin.Instance!.Configuration; 54 | emailBody = config.Body; 55 | 56 | newslettersDir = config.NewsletterDir; // newsletterdir 57 | Directory.CreateDirectory(newslettersDir); 58 | 59 | // if no newsletter filename is saved or the file doesn't exist 60 | if (config.NewsletterFileName.Length == 0 || File.Exists(newslettersDir + config.NewsletterFileName)) 61 | { 62 | // use date to create filename 63 | string currDate = DateTime.Today.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture); 64 | newsletterHTMLFile = newslettersDir + currDate + "_Newsletter.html"; 65 | } 66 | else 67 | { 68 | newsletterHTMLFile = newslettersDir + config.NewsletterFileName; 69 | } 70 | 71 | logger.Info("Newsletter will be saved to: " + newsletterHTMLFile); 72 | } 73 | 74 | public string GetDefaultHTMLBody() 75 | { 76 | emailBody = config.Body; 77 | return emailBody; 78 | } 79 | 80 | public string TemplateReplace(string htmlObj, string replaceKey, object replaceValue, bool finalPass = false) 81 | { 82 | logger.Debug("Replacing {} params:\n " + htmlObj); 83 | if (replaceValue is null) 84 | { 85 | logger.Debug($"Replace string is null.. Nothing to replace"); 86 | return htmlObj; 87 | } 88 | 89 | if (replaceKey == "{RunTime}" && (int)replaceValue == 0) 90 | { 91 | logger.Debug($"{replaceKey} == {replaceValue}"); 92 | logger.Debug("Skipping replace.."); 93 | return htmlObj; 94 | } 95 | 96 | logger.Debug($"Replace Value {replaceKey} with " + replaceValue); 97 | 98 | // Dictionary html_params = new Dictionary(); 99 | // html_params.Add("{Date}", DateTime.Today.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture)); 100 | // html_params.Add(replaceKey, replaceValue); 101 | 102 | htmlObj = htmlObj.Replace(replaceKey, replaceValue.ToString(), StringComparison.Ordinal); 103 | // logger.Debug("HERE\n " + htmlObj) 104 | 105 | // foreach (KeyValuePair param in html_params) 106 | // { 107 | // if (param.Value is not null) 108 | // { 109 | // htmlObj = htmlObj.Replace(param.Key, param.Value.ToString(), StringComparison.Ordinal); 110 | // // logger.Debug("HERE\n " + htmlObj) 111 | // } 112 | // } 113 | 114 | logger.Debug("New HTML OBJ: \n" + htmlObj); 115 | return htmlObj; 116 | } 117 | 118 | public string BuildDataHtmlStringFromNewsletterData() 119 | { 120 | List completed = new List(); 121 | string builtHTMLString = string.Empty; 122 | // pull data from CurrNewsletterData table 123 | 124 | try 125 | { 126 | db.CreateConnection(); 127 | 128 | foreach (var row in db.Query("SELECT * FROM CurrNewsletterData;")) 129 | { 130 | if (row is not null) 131 | { 132 | JsonFileObj item = jsonHelper.ConvertToObj(row); 133 | // scan through all items and get all Season numbers and Episodes 134 | // (string seasonInfo, string episodeInfo) = ParseSeriesInfo(obj, readDataFile); 135 | if (completed.Contains(item.Title)) 136 | { 137 | continue; 138 | } 139 | 140 | string seaEpsHtml = string.Empty; 141 | if (item.Type == "Series") 142 | { 143 | // for series only 144 | List parsedInfoList = ParseSeriesInfo(item); 145 | seaEpsHtml += GetSeasonEpisodeHTML(parsedInfoList); 146 | } 147 | 148 | var tmp_entry = config.Entry; 149 | // logger.Debug("TESTING"); 150 | // logger.Debug(item.GetDict()["Filename"]); 151 | 152 | foreach (KeyValuePair ele in item.GetReplaceDict()) 153 | { 154 | if (ele.Value is not null) 155 | { 156 | tmp_entry = this.TemplateReplace(tmp_entry, ele.Key, ele.Value); 157 | } 158 | } 159 | 160 | builtHTMLString += tmp_entry.Replace("{SeasonEpsInfo}", seaEpsHtml, StringComparison.Ordinal) 161 | .Replace("{ServerURL}", config.Hostname, StringComparison.Ordinal); 162 | completed.Add(item.Title); 163 | } 164 | } 165 | } 166 | catch (Exception e) 167 | { 168 | logger.Error("An error has occured: " + e); 169 | } 170 | finally 171 | { 172 | db.CloseConnection(); 173 | } 174 | 175 | return builtHTMLString; 176 | } 177 | 178 | private string GetSeasonEpisodeHTML(List list) 179 | { 180 | string html = string.Empty; 181 | foreach (NlDetailsJson obj in list) 182 | { 183 | logger.Debug("SNIPPET OBJ: " + JsonConvert.SerializeObject(obj)); 184 | // html += "
Season: " + obj.Season + " - Eps. " + obj.EpisodeRange + "
"; 185 | html += "Season: " + obj.Season + " - Eps. " + obj.EpisodeRange + "
"; 186 | } 187 | 188 | return html; 189 | } 190 | 191 | private List ParseSeriesInfo(JsonFileObj currObj) 192 | { 193 | List compiledList = new List(); 194 | List finalList = new List(); 195 | 196 | foreach (var row in db.Query("SELECT * FROM CurrNewsletterData WHERE Title='" + currObj.Title + "';")) 197 | { 198 | if (row is not null) 199 | { 200 | JsonFileObj helper = new JsonFileObj(); 201 | JsonFileObj itemObj = helper.ConvertToObj(row); 202 | 203 | NlDetailsJson tempVar = new NlDetailsJson() 204 | { 205 | Title = itemObj.Title, 206 | Season = itemObj.Season, 207 | Episode = itemObj.Episode 208 | }; 209 | 210 | logger.Debug("tempVar.Season: " + tempVar.Season + " : tempVar.Episode: " + tempVar.Episode); 211 | compiledList.Add(tempVar); 212 | } 213 | } 214 | 215 | List tempEpsList = new List(); 216 | NlDetailsJson currSeriesDetailsObj = new NlDetailsJson(); 217 | 218 | int currSeason = -1; 219 | bool newSeason = true; 220 | int list_len = compiledList.Count; 221 | int count = 1; 222 | foreach (NlDetailsJson item in SortListBySeason(SortListByEpisode(compiledList))) 223 | { 224 | logger.Debug("After Sort in foreach: Season::" + item.Season + "; Episode::" + item.Episode); 225 | logger.Debug("Count/list_len: " + count + "/" + list_len); 226 | 227 | NlDetailsJson CopyJsonFromExisting(NlDetailsJson obj) 228 | { 229 | NlDetailsJson newJson = new NlDetailsJson(); 230 | newJson.Season = obj.Season; 231 | newJson.EpisodeRange = obj.EpisodeRange; 232 | return newJson; 233 | } 234 | 235 | void AddNewSeason() 236 | { 237 | // logger.Debug("AddNewSeason()"); 238 | currSeriesDetailsObj.Season = currSeason = item.Season; 239 | newSeason = false; 240 | tempEpsList.Add(item.Episode); 241 | } 242 | 243 | void AddCurrentSeason() 244 | { 245 | // logger.Debug("AddCurrentSeason()"); 246 | logger.Debug("Seasons Match " + currSeason + "::" + item.Season); 247 | tempEpsList.Add(item.Episode); 248 | } 249 | 250 | void EndOfSeason() 251 | { 252 | // process season, them increment 253 | logger.Debug("EndOfSeason()"); 254 | logger.Debug($"tempEpsList Size: {tempEpsList.Count}"); 255 | if (tempEpsList.Count != 0) 256 | { 257 | logger.Debug("tempEpsList is populated"); 258 | tempEpsList.Sort(); 259 | if (IsIncremental(tempEpsList)) 260 | { 261 | currSeriesDetailsObj.EpisodeRange = tempEpsList.First() + " - " + tempEpsList.Last(); 262 | } 263 | else if (tempEpsList.First() == tempEpsList.Last()) 264 | { 265 | currSeriesDetailsObj.EpisodeRange = tempEpsList.First().ToString(System.Globalization.CultureInfo.CurrentCulture); 266 | } 267 | else 268 | { 269 | string epList = string.Empty; 270 | int firstRangeEp, prevEp; 271 | firstRangeEp = prevEp = -1; 272 | 273 | bool IsNext(int prev, int curr) 274 | { 275 | logger.Debug("Checking Prev and Curr.."); 276 | logger.Debug($"prev: {prev} :: curr: {curr}"); 277 | logger.Debug(prev + 1); 278 | if (curr == prev + 1) 279 | { 280 | return true; 281 | } 282 | 283 | return false; 284 | } 285 | 286 | string ProcessEpString(int firstRangeEp, int prevEp) 287 | { 288 | if (firstRangeEp == prevEp) 289 | { 290 | epList += firstRangeEp + ","; 291 | } 292 | else 293 | { 294 | epList += firstRangeEp + "-" + prevEp + ","; 295 | } 296 | 297 | return epList; 298 | } 299 | 300 | foreach (int ep in tempEpsList) 301 | { 302 | logger.Debug("-------------------"); 303 | logger.Debug($"FOREACH firstRangeEp :: prevEp :: ep = {firstRangeEp} :: {prevEp} :: {ep} "); 304 | logger.Debug(ep == tempEpsList.Last()); 305 | // if first passthrough 306 | if (firstRangeEp == -1) 307 | { 308 | logger.Debug("First pass of episode list"); 309 | firstRangeEp = prevEp = ep; 310 | continue; 311 | } 312 | 313 | // If incremental 314 | if (IsNext(prevEp, ep) && (ep != tempEpsList.Last())) 315 | { 316 | logger.Debug("Is Next and Isn't last"); 317 | prevEp = ep; 318 | continue; 319 | } 320 | else if (IsNext(prevEp, ep) && (ep == tempEpsList.Last())) 321 | { 322 | logger.Debug("Is Next and Is last"); 323 | prevEp = ep; 324 | ProcessEpString(firstRangeEp, prevEp); 325 | } 326 | else if (!IsNext(prevEp, ep) && (ep == tempEpsList.Last())) 327 | { 328 | logger.Debug("Isn't Next and Is last"); 329 | // process previous 330 | ProcessEpString(firstRangeEp, prevEp); 331 | // process last episode 332 | epList += ep; 333 | continue; 334 | } 335 | else 336 | { 337 | logger.Debug("Isn't Next and Isn't last"); 338 | ProcessEpString(firstRangeEp, prevEp); 339 | firstRangeEp = prevEp = ep; 340 | } 341 | } 342 | 343 | // better numbering here 344 | logger.Debug($"epList: {epList}"); 345 | currSeriesDetailsObj.EpisodeRange = epList.TrimEnd(','); 346 | } 347 | 348 | logger.Debug("Adding to finalListObj: " + JsonConvert.SerializeObject(currSeriesDetailsObj)); 349 | // finalList.Add(currSeriesDetailsObj); 350 | finalList.Add(CopyJsonFromExisting(currSeriesDetailsObj)); 351 | 352 | // increment season 353 | currSeriesDetailsObj.Season = currSeason = item.Season; 354 | currSeriesDetailsObj.EpisodeRange = string.Empty; 355 | 356 | // currSeason = item.Season; 357 | tempEpsList.Clear(); 358 | newSeason = true; 359 | } 360 | } 361 | 362 | logger.Debug("CurrItem Season/Episode number: " + item.Season + "/" + item.Episode); 363 | if (newSeason) 364 | { 365 | AddNewSeason(); 366 | } 367 | else if (currSeason == item.Season) // && (count < list_len)) 368 | { 369 | AddCurrentSeason(); 370 | } 371 | else if (count < list_len) 372 | { 373 | EndOfSeason(); 374 | AddNewSeason(); 375 | } 376 | else if (count == list_len) 377 | { 378 | EndOfSeason(); 379 | } 380 | else 381 | { 382 | EndOfSeason(); 383 | } 384 | 385 | if (count == list_len) 386 | { 387 | EndOfSeason(); 388 | } 389 | 390 | count++; 391 | } 392 | 393 | logger.Debug("FinalList Length: " + finalList.Count); 394 | 395 | foreach (NlDetailsJson item in finalList) 396 | { 397 | logger.Debug("FinalListObjs: " + JsonConvert.SerializeObject(item)); 398 | } 399 | 400 | return finalList; 401 | } 402 | 403 | private bool IsIncremental(List values) 404 | { 405 | return values.Skip(1).Select((v, i) => v == (values[i] + 1)).All(v => v); 406 | } 407 | 408 | private List SortListBySeason(List list) 409 | { 410 | return list.OrderBy(x => x.Season).ToList(); 411 | } 412 | 413 | private List SortListByEpisode(List list) 414 | { 415 | return list.OrderBy(x => x.Episode).ToList(); 416 | } 417 | 418 | public string ReplaceBodyWithBuiltString(string body, string nlData) 419 | { 420 | return body.Replace("{EntryData}", nlData, StringComparison.Ordinal); 421 | } 422 | 423 | public void CleanUp(string htmlBody) 424 | { 425 | // save newsletter to file 426 | logger.Info("Saving HTML file"); 427 | WriteFile(write, newsletterHTMLFile, htmlBody); 428 | 429 | // append newsletter cycle data to Archive.txt 430 | CopyNewsletterDataToArchive(); 431 | } 432 | 433 | private void CopyNewsletterDataToArchive() 434 | { 435 | logger.Info("Appending NewsletterData for Current Newsletter Cycle to Archive Database.."); 436 | 437 | // copy tables 438 | db.ExecuteSQL("INSERT INTO ArchiveData SELECT * FROM CurrNewsletterData;"); 439 | db.ExecuteSQL("DELETE FROM CurrNewsletterData;"); 440 | } 441 | 442 | private void WriteFile(string method, string path, string value) 443 | { 444 | if (method == append) 445 | { 446 | File.AppendAllText(path, value); 447 | } 448 | else if (method == write) 449 | { 450 | File.WriteAllText(path, value); 451 | } 452 | } 453 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Emails/smtp.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591 2 | using System; 3 | using System.Globalization; 4 | using System.Net; 5 | using System.Net.Mail; 6 | using System.Text.RegularExpressions; 7 | using Jellyfin.Plugin.Newsletters.Configuration; 8 | using Jellyfin.Plugin.Newsletters.Emails.HTMLBuilder; 9 | using Jellyfin.Plugin.Newsletters.LOGGER; 10 | using Jellyfin.Plugin.Newsletters.Shared.DATA; 11 | using MediaBrowser.Common.Api; 12 | using Microsoft.AspNetCore.Authorization; 13 | using Microsoft.AspNetCore.Mvc; 14 | 15 | // using System.Net.NetworkCredential; 16 | 17 | namespace Jellyfin.Plugin.Newsletters.Emails.EMAIL; 18 | 19 | /// 20 | /// Interaction logic for SendMail.xaml. 21 | /// 22 | // [Route("newsletters/[controller]")] 23 | [Authorize(Policy = Policies.RequiresElevation)] 24 | [ApiController] 25 | [Route("Smtp")] 26 | public class Smtp : ControllerBase 27 | { 28 | private readonly PluginConfiguration config; 29 | // private readonly string newsletterDataFile; 30 | private SQLiteDatabase db; 31 | private Logger logger; 32 | 33 | public Smtp() 34 | { 35 | db = new SQLiteDatabase(); 36 | logger = new Logger(); 37 | config = Plugin.Instance!.Configuration; 38 | } 39 | 40 | [HttpPost("SendTestMail")] 41 | public void SendTestMail() 42 | { 43 | MailMessage mail; 44 | SmtpClient smtp; 45 | 46 | try 47 | { 48 | logger.Debug("Sending out test mail!"); 49 | mail = new MailMessage(); 50 | 51 | mail.From = new MailAddress(config.FromAddr); 52 | mail.To.Clear(); 53 | mail.Subject = "Jellyfin Newsletters - Test"; 54 | mail.Body = "Success! You have properly configured your email notification settings"; 55 | mail.IsBodyHtml = false; 56 | 57 | foreach (string email in config.ToAddr.Split(',')) 58 | { 59 | mail.Bcc.Add(email.Trim()); 60 | } 61 | 62 | smtp = new SmtpClient(config.SMTPServer, config.SMTPPort); 63 | smtp.Credentials = new NetworkCredential(config.SMTPUser, config.SMTPPass); 64 | smtp.EnableSsl = true; 65 | smtp.Send(mail); 66 | } 67 | catch (Exception e) 68 | { 69 | logger.Error("An error has occured: " + e); 70 | } 71 | } 72 | 73 | [HttpPost("SendSmtp")] 74 | // [ProducesResponseType(StatusCodes.Status201Created)] 75 | // [ProducesResponseType(StatusCodes.Status400BadRequest)] 76 | public void SendEmail() 77 | { 78 | try 79 | { 80 | db.CreateConnection(); 81 | 82 | if (NewsletterDbIsPopulated()) 83 | { 84 | logger.Debug("Sending out mail!"); 85 | // Smtp varsmtp = new Smtp(); 86 | MailMessage mail = new MailMessage(); 87 | string smtpAddress = config.SMTPServer; 88 | int portNumber = config.SMTPPort; 89 | bool enableSSL = true; 90 | string emailFromAddress = config.FromAddr; 91 | string username = config.SMTPUser; 92 | string password = config.SMTPPass; 93 | string emailToAddress = config.ToAddr; 94 | string subject = config.Subject; 95 | // string body; 96 | 97 | HtmlBuilder hb = new HtmlBuilder(); 98 | 99 | string body = hb.GetDefaultHTMLBody(); 100 | string builtString = hb.BuildDataHtmlStringFromNewsletterData(); 101 | // string finalBody = hb.ReplaceBodyWithBuiltString(body, builtString); 102 | // string finalBody = hb.TemplateReplace(hb.ReplaceBodyWithBuiltString(body, builtString), "{ServerURL}", config.Hostname); 103 | builtString = hb.TemplateReplace(hb.ReplaceBodyWithBuiltString(body, builtString), "{ServerURL}", config.Hostname); 104 | string currDate = DateTime.Today.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture); 105 | builtString = builtString.Replace("{Date}", currDate, StringComparison.Ordinal); 106 | 107 | mail.From = new MailAddress(emailFromAddress, emailFromAddress); 108 | mail.To.Clear(); 109 | mail.Subject = subject; 110 | mail.Body = Regex.Replace(builtString, "{[A-za-z]*}", " "); // Final cleanup 111 | mail.IsBodyHtml = true; 112 | 113 | foreach (string email in emailToAddress.Split(',')) 114 | { 115 | mail.Bcc.Add(email.Trim()); 116 | } 117 | 118 | // mail.Attachments.Add(new Attachment("D:\\TestFile.txt"));//--Uncomment this to send any attachment 119 | SmtpClient smtp = new SmtpClient(smtpAddress, portNumber); 120 | smtp.Credentials = new NetworkCredential(username, password); 121 | smtp.EnableSsl = enableSSL; 122 | smtp.Send(mail); 123 | 124 | hb.CleanUp(builtString); 125 | } 126 | else 127 | { 128 | logger.Info("There is no Newsletter data.. Have I scanned or sent out a newsletter recently?"); 129 | } 130 | } 131 | catch (Exception e) 132 | { 133 | logger.Error("An error has occured: " + e); 134 | } 135 | finally 136 | { 137 | db.CloseConnection(); 138 | } 139 | } 140 | 141 | private bool NewsletterDbIsPopulated() 142 | { 143 | foreach (var row in db.Query("SELECT COUNT(*) FROM CurrNewsletterData;")) 144 | { 145 | if (row is not null) 146 | { 147 | if (int.Parse(row[0].ToString(), CultureInfo.CurrentCulture) > 0) 148 | { 149 | db.CloseConnection(); 150 | return true; 151 | } 152 | } 153 | } 154 | 155 | db.CloseConnection(); 156 | return false; 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Jellyfin.Plugin.Newsletters.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | Jellyfin.Plugin.Newsletters 6 | true 7 | false 8 | enable 9 | AllEnabledByDefault 10 | ../jellyfin.ruleset 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | Always 37 | 38 | 39 | Always 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Logger.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable SA1611, CS0162 2 | using System; 3 | using System.IO; 4 | using Jellyfin.Plugin.Newsletters.Configuration; 5 | 6 | namespace Jellyfin.Plugin.Newsletters.LOGGER; 7 | 8 | /// 9 | /// Initializes a new instance of the class. 10 | /// 11 | public class Logger 12 | { 13 | private readonly PluginConfiguration config; 14 | private readonly string logFile; 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public Logger() 20 | { 21 | config = Plugin.Instance!.Configuration; 22 | logFile = $"{config.LogDirectoryPath}/{GetDate()}_Newsletter.log"; 23 | } 24 | 25 | /// 26 | /// Initializes a new instance of the class. 27 | /// 28 | public void Debug(object msg) 29 | { 30 | PluginConfiguration config = Plugin.Instance!.Configuration; 31 | if (config.DebugMode) 32 | { 33 | Info(msg); 34 | } 35 | } 36 | 37 | /// 38 | /// Inform info into the logs. 39 | /// 40 | public void Info(object msg) 41 | { 42 | Inform(msg, "INFO"); 43 | } 44 | 45 | /// 46 | /// Inform warn into the logs. 47 | /// 48 | public void Warn(object msg) 49 | { 50 | Inform(msg, "WARN"); 51 | } 52 | 53 | /// 54 | /// Inform error into the logs. 55 | /// 56 | public void Error(object msg) 57 | { 58 | Inform(msg, "ERR"); 59 | } 60 | 61 | /// 62 | /// Inform specific type of warning into the logs. 63 | /// 64 | /// The message to infrom into the logs. 65 | /// Type of warning ("ERR", "WARN", "INFO"). 66 | private void Inform(object msg, string type) 67 | { 68 | string logMsgPrefix = $"[NLP]: {GetDateTime()} - [{type}] "; 69 | Console.WriteLine($"{logMsgPrefix}{msg}"); 70 | File.AppendAllText(logFile, $"{logMsgPrefix}{msg}\n"); 71 | } 72 | 73 | private string GetDateTime() 74 | { 75 | return DateTime.Now.ToString("[yyyy-MM-dd] :: [HH:mm:ss]", System.Globalization.CultureInfo.CurrentCulture); 76 | } 77 | 78 | private string GetDate() 79 | { 80 | return DateTime.Now.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture); 81 | } 82 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.IO; 5 | using Jellyfin.Plugin.Newsletters.Configuration; 6 | using Jellyfin.Plugin.Newsletters.LOGGER; 7 | using MediaBrowser.Common.Configuration; 8 | using MediaBrowser.Common.Plugins; 9 | using MediaBrowser.Model.Plugins; 10 | using MediaBrowser.Model.Serialization; 11 | 12 | namespace Jellyfin.Plugin.Newsletters; 13 | 14 | /// 15 | /// The main plugin. 16 | /// 17 | public class Plugin : BasePlugin, IHasWebPages 18 | { 19 | private Logger logger; 20 | 21 | /// 22 | /// Initializes a new instance of the class. 23 | /// 24 | /// Instance of the interface. 25 | /// Instance of the interface. 26 | public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) 27 | : base(applicationPaths, xmlSerializer) 28 | { 29 | Instance = this; 30 | logger = new Logger(); 31 | 32 | void SetConfigPaths(IApplicationPaths dataPaths) 33 | { 34 | // custom code 35 | // IApplication Paths 36 | PluginConfiguration config = Plugin.Instance!.Configuration; 37 | config.DataPath = dataPaths.DataPath; 38 | config.TempDirectory = dataPaths.TempDirectory; 39 | config.PluginsPath = dataPaths.PluginsPath; 40 | config.ProgramDataPath = dataPaths.ProgramDataPath; 41 | config.ProgramSystemPath = dataPaths.ProgramSystemPath; 42 | config.SystemConfigurationFilePath = dataPaths.SystemConfigurationFilePath; 43 | config.LogDirectoryPath = dataPaths.LogDirectoryPath; 44 | 45 | // Custom Paths 46 | config.NewsletterDir = $"{config.TempDirectory}/Newsletters/"; 47 | } 48 | 49 | SetConfigPaths(applicationPaths); 50 | } 51 | 52 | /// 53 | public override string Name => "Newsletters"; 54 | 55 | /// 56 | public override Guid Id => Guid.Parse("60f478ab-2dd6-4ea0-af10-04d033f75979"); 57 | 58 | /// 59 | /// Gets the current plugin instance. 60 | /// 61 | public static Plugin? Instance { get; private set; } 62 | 63 | /// 64 | public IEnumerable GetPages() 65 | { 66 | return new[] 67 | { 68 | new PluginPageInfo 69 | { 70 | Name = this.Name, 71 | EmbeddedResourcePath = string.Format(CultureInfo.InvariantCulture, "{0}.Configuration.configPage.html", GetType().Namespace) 72 | } 73 | }; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Scanner/PosterImageHandler.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591, SYSLIB0014, CA1002, CS0162 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Concurrent; 5 | using System.Collections.Generic; 6 | using System.Collections.Specialized; 7 | using System.Globalization; 8 | using System.IO; 9 | using System.Net; 10 | using System.Net.Http; 11 | using System.Threading; 12 | using System.Threading.Tasks; 13 | using Jellyfin.Plugin.Newsletters.Configuration; 14 | using Jellyfin.Plugin.Newsletters.LOGGER; 15 | using Jellyfin.Plugin.Newsletters.Scripts.ENTITIES; 16 | using Jellyfin.Plugin.Newsletters.Scripts.SCRAPER; 17 | using Jellyfin.Plugin.Newsletters.Shared.DATA; 18 | using MediaBrowser.Common.Configuration; 19 | using MediaBrowser.Common.Plugins; 20 | using MediaBrowser.Controller; 21 | using MediaBrowser.Controller.Entities; 22 | using MediaBrowser.Controller.Library; 23 | using MediaBrowser.Model.Tasks; 24 | using Newtonsoft.Json; 25 | using Newtonsoft.Json.Linq; 26 | // using Microsoft.Extensions.Logging; 27 | 28 | namespace Jellyfin.Plugin.Newsletters.Scanner.NLImageHandler; 29 | 30 | public class PosterImageHandler 31 | { 32 | // Global Vars 33 | // Readonly 34 | private readonly PluginConfiguration config; 35 | private Logger logger; 36 | private SQLiteDatabase db; 37 | 38 | // Non-readonly 39 | private List archiveSeriesList; 40 | // private List fileList; 41 | 42 | public PosterImageHandler() 43 | { 44 | logger = new Logger(); 45 | db = new SQLiteDatabase(); 46 | config = Plugin.Instance!.Configuration; 47 | 48 | archiveSeriesList = new List(); 49 | } 50 | 51 | public string FetchImagePoster(JsonFileObj item) 52 | { 53 | // Check which config option for posters are selected 54 | logger.Debug($"HOSTING TYPE: {config.PHType}"); 55 | switch (config.PHType) 56 | { 57 | case "Imgur": 58 | return UploadToImgur(item.PosterPath); 59 | break; 60 | case "JfHosting": 61 | return $"{config.Hostname}/Items/{item.ItemID}/Images/Primary"; 62 | break; 63 | default: 64 | return "Something Went Wrong"; 65 | break; 66 | } 67 | 68 | // return UploadToImgur(posterFilePath); 69 | } 70 | 71 | private string UploadToImgur(string posterFilePath) 72 | { 73 | WebClient wc = new(); 74 | 75 | NameValueCollection values = new() 76 | { 77 | { "image", Convert.ToBase64String(File.ReadAllBytes(posterFilePath)) } 78 | }; 79 | 80 | wc.Headers.Add("Authorization", "Client-ID " + config.ApiKey); 81 | 82 | try 83 | { 84 | byte[] response = wc.UploadValues("https://api.imgur.com/3/upload.xml", values); 85 | 86 | string res = System.Text.Encoding.Default.GetString(response); 87 | 88 | logger.Debug("Imgur Response: " + res); 89 | 90 | logger.Info("Imgur Uploaded! Link:"); 91 | logger.Info(res.Split("")[1].Split("")[0]); 92 | 93 | return res.Split("")[1].Split("")[0]; 94 | } 95 | catch (WebException e) 96 | { 97 | logger.Debug("WebClient Return STATUS: " + e.Status); 98 | logger.Debug(e.ToString().Split(")")[0].Split("(")[1]); 99 | try 100 | { 101 | return e.ToString().Split(")")[0].Split("(")[1]; 102 | } 103 | catch (Exception ex) 104 | { 105 | logger.Error("Error caught while trying to parse webException error: " + ex); 106 | return "ERR"; 107 | } 108 | } 109 | } 110 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Scanner/Scraper.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591, CA1002, SA1005 // remove SA1005 to clean code 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Concurrent; 5 | using System.Collections.Generic; 6 | using System.Globalization; 7 | using System.IO; 8 | using System.Linq; 9 | using System.Threading; 10 | using System.Threading.Tasks; 11 | using Jellyfin.Data.Enums; 12 | using Jellyfin.Plugin.Newsletters.Configuration; 13 | using Jellyfin.Plugin.Newsletters.LOGGER; 14 | using Jellyfin.Plugin.Newsletters.Scanner.NLImageHandler; 15 | using Jellyfin.Plugin.Newsletters.Scripts.ENTITIES; 16 | using Jellyfin.Plugin.Newsletters.Shared.DATA; 17 | using MediaBrowser.Common.Configuration; 18 | using MediaBrowser.Common.Plugins; 19 | using MediaBrowser.Controller; 20 | using MediaBrowser.Controller.Entities; 21 | using MediaBrowser.Controller.Library; 22 | using MediaBrowser.Model.Tasks; 23 | using Newtonsoft.Json; 24 | using Newtonsoft.Json.Linq; 25 | 26 | // using Microsoft.Extensions.Logging; 27 | 28 | namespace Jellyfin.Plugin.Newsletters.Scripts.SCRAPER; 29 | 30 | public class Scraper 31 | { 32 | // Global Vars 33 | // Readonly 34 | private readonly PluginConfiguration config; 35 | // private readonly string currRunScanList; 36 | // private readonly string archiveFile; 37 | // private readonly string currNewsletterDataFile; 38 | private readonly ILibraryManager libManager; 39 | 40 | // Non-readonly 41 | private int totalLibCount; 42 | private int currCount; 43 | private PosterImageHandler imageHandler; 44 | private SQLiteDatabase db; 45 | private JsonFileObj jsonHelper; 46 | private Logger logger; 47 | private IProgress progress; 48 | private CancellationToken cancelToken; 49 | // private List archiveObj; 50 | 51 | public Scraper(ILibraryManager libraryManager, IProgress passedProgress, CancellationToken cancellationToken) 52 | { 53 | logger = new Logger(); 54 | jsonHelper = new JsonFileObj(); 55 | progress = passedProgress; 56 | cancelToken = cancellationToken; 57 | config = Plugin.Instance!.Configuration; 58 | libManager = libraryManager; 59 | 60 | totalLibCount = currCount = 0; 61 | 62 | imageHandler = new PosterImageHandler(); 63 | db = new SQLiteDatabase(); 64 | 65 | logger.Debug("Setting Config Paths: "); 66 | logger.Debug("\n DataPath: " + config.DataPath + 67 | "\n TempDirectory: " + config.TempDirectory + 68 | "\n PluginsPath: " + config.PluginsPath + 69 | "\n NewsletterDir: " + config.NewsletterDir + 70 | "\n ProgramDataPath: " + config.ProgramDataPath + 71 | "\n ProgramSystemPath: " + config.ProgramSystemPath + 72 | "\n SystemConfigurationFilePath: " + config.SystemConfigurationFilePath + 73 | "\n LogDirectoryPath: " + config.LogDirectoryPath ); 74 | } 75 | 76 | // This is the main function 77 | public Task GetSeriesData() 78 | { 79 | logger.Info("Gathering Data..."); 80 | try 81 | { 82 | db.CreateConnection(); 83 | BuildJsonObjsToCurrScanfile(); 84 | CopyCurrRunDataToNewsletterData(); 85 | } 86 | catch (Exception e) 87 | { 88 | logger.Error("An error has occured: " + e); 89 | } 90 | finally 91 | { 92 | db.CloseConnection(); 93 | } 94 | 95 | return Task.CompletedTask; 96 | } 97 | 98 | private void BuildJsonObjsToCurrScanfile() 99 | { 100 | if (!config.SeriesEnabled && !config.MoviesEnabled) 101 | { 102 | logger.Info("No Libraries Enabled In Config!"); 103 | } 104 | 105 | if (config.SeriesEnabled) 106 | { 107 | InternalItemsQuery series = new InternalItemsQuery(); 108 | series.IncludeItemTypes = new[] { BaseItemKind.Episode }; 109 | BuildObjs(libManager.GetItemList(series), "Series"); // populate series 110 | } 111 | 112 | if (config.MoviesEnabled) 113 | { 114 | InternalItemsQuery movie = new InternalItemsQuery(); 115 | movie.IncludeItemTypes = new[] { BaseItemKind.Movie }; 116 | BuildObjs(libManager.GetItemList(movie), "Movie"); // populate movies 117 | } 118 | } 119 | 120 | public void BuildObjs(List items, string type) 121 | { 122 | logger.Info($"Parsing {type}.."); 123 | BaseItem episode, season, series; 124 | totalLibCount = items.Count; 125 | logger.Info($"Scan Size: {totalLibCount}"); 126 | logger.Info($"Scanning '{type}'"); 127 | foreach (BaseItem item in items) 128 | { 129 | logger.Debug("---------------"); 130 | currCount++; 131 | progress.Report((double)currCount / (double)totalLibCount * 100); 132 | if (item is not null) 133 | { 134 | try 135 | { 136 | if (type == "Series") 137 | { 138 | episode = item; 139 | season = item.GetParent(); 140 | series = item.GetParent().GetParent(); 141 | } 142 | else if (type == "Movie") 143 | { 144 | episode = season = series = item; 145 | } 146 | else 147 | { 148 | logger.Error("Something went wrong.."); 149 | continue; 150 | } 151 | 152 | logger.Debug($"ItemId: " + series.Id.ToString("N")); // series ItemId 153 | logger.Debug($"{type}: {series.Name}"); // Title 154 | logger.Debug($"LocationType: " + episode.LocationType.ToString()); 155 | if (episode.LocationType.ToString() == "Virtual") 156 | { 157 | logger.Debug($"No physical path.. Skipping..."); 158 | continue; 159 | } 160 | 161 | logger.Debug($"Season: {season.Name}"); // Season Name 162 | logger.Debug($"Episode Name: {episode.Name}"); // episode Name 163 | logger.Debug($"Episode Number: {episode.IndexNumber}"); // episode Name 164 | logger.Debug($"Overview: {series.Overview}"); // series overview 165 | logger.Debug($"ImageInfo: {series.PrimaryImagePath}"); 166 | logger.Debug($"Filepath: " + episode.Path); // Filepath, episode.Path is cleaner, but may be empty 167 | 168 | // NEW PARAMS 169 | logger.Debug($"PremiereDate: {series.PremiereDate}"); // series PremiereDate 170 | logger.Debug($"OfficialRating: " + series.OfficialRating); // TV-14, TV-PG, etc 171 | // logger.Info($"CriticRating: " + series.CriticRating); 172 | // logger.Info($"CustomRating: " + series.CustomRating); 173 | logger.Debug($"CommunityRating: " + series.CommunityRating); // 8.5, 9.2, etc 174 | logger.Debug($"RunTime: " + (int)((float)episode.RunTimeTicks! / 10000 / 60000) + " minutes"); 175 | } 176 | catch (Exception e) 177 | { 178 | logger.Error("Error processing item.."); 179 | logger.Error(e); 180 | continue; 181 | } 182 | 183 | JsonFileObj currFileObj = new JsonFileObj(); 184 | currFileObj.Filename = episode.Path; 185 | currFileObj.Title = series.Name; 186 | currFileObj.Type = type; 187 | 188 | if (series.PremiereDate is not null) 189 | { 190 | currFileObj.PremiereYear = series.PremiereDate.ToString()!.Split(' ')[0].Split('/')[2]; // NEW {PremierYear} 191 | logger.Debug($"PremiereYear: {currFileObj.PremiereYear}"); 192 | } 193 | 194 | currFileObj.RunTime = (int)((float)episode.RunTimeTicks / 10000 / 60000); 195 | currFileObj.OfficialRating = series.OfficialRating; 196 | currFileObj.CommunityRating = series.CommunityRating; 197 | 198 | if (!InDatabase("CurrRunData", currFileObj.Filename.Replace("'", string.Empty, StringComparison.Ordinal)) && 199 | !InDatabase("CurrNewsletterData", currFileObj.Filename.Replace("'", string.Empty, StringComparison.Ordinal)) && 200 | !InDatabase("ArchiveData", currFileObj.Filename.Replace("'", string.Empty, StringComparison.Ordinal))) 201 | { 202 | try 203 | { 204 | if (episode.IndexNumber is int && episode.IndexNumber is not null) 205 | { 206 | currFileObj.Episode = (int)episode.IndexNumber; 207 | } 208 | 209 | currFileObj.SeriesOverview = series.Overview; 210 | currFileObj.ItemID = series.Id.ToString("N"); 211 | 212 | logger.Debug("Checking if Primary Image Exists for series"); 213 | if (series.PrimaryImagePath != null) 214 | { 215 | logger.Debug("Primary Image series found!"); 216 | currFileObj.PosterPath = series.PrimaryImagePath; 217 | } 218 | else if (episode.PrimaryImagePath != null) 219 | { 220 | logger.Debug("Primary Image series not found. Pulling from Episode"); 221 | currFileObj.PosterPath = episode.PrimaryImagePath; 222 | } 223 | else 224 | { 225 | logger.Warn("Primary Poster not found.."); 226 | logger.Warn("This may be due to filesystem not being formatted properly."); 227 | logger.Warn($"Make sure {currFileObj.Filename} follows the correct formatting below:"); 228 | logger.Warn(".../MyLibraryName/Series_Name/Season#_or_Specials/Episode.{ext}"); 229 | } 230 | 231 | logger.Debug("Checking if PosterPath Exists"); 232 | if ((currFileObj.PosterPath != null) && (currFileObj.PosterPath.Length > 0)) 233 | { 234 | string url = SetImageURL(currFileObj); 235 | 236 | if ((url == "429") || (url == "ERR")) 237 | { 238 | logger.Debug("URL is not attainable at this time. Stopping scan.. Will resume during next scan."); 239 | logger.Debug("Not processing current file: " + currFileObj.Filename); 240 | break; 241 | } 242 | 243 | currFileObj.ImageURL = url; 244 | } 245 | 246 | logger.Debug("Parsing Season Number"); 247 | try 248 | { 249 | currFileObj.Season = int.Parse(season.Name.Split(' ')[1], CultureInfo.CurrentCulture); 250 | } 251 | catch (Exception e) 252 | { 253 | logger.Warn($"Encountered an error parsing Season Number for: {currFileObj.Filename}"); 254 | logger.Debug(e); 255 | logger.Warn("Setting Season number to 0 (SPECIALS)"); 256 | currFileObj.Season = 0; 257 | } 258 | } 259 | catch (Exception e) 260 | { 261 | logger.Error($"Encountered an error parsing: {currFileObj.Filename}"); 262 | logger.Error(e); 263 | } 264 | finally 265 | { 266 | // save to "database" : Table currRunScanList 267 | logger.Debug("Adding to CurrRunData DB..."); 268 | currFileObj = NoNull(currFileObj); 269 | db.ExecuteSQL("INSERT INTO CurrRunData (Filename, Title, Season, Episode, SeriesOverview, ImageURL, ItemID, PosterPath, Type, PremiereYear, RunTime, OfficialRating, CommunityRating) " + 270 | "VALUES (" + 271 | SanitizeDbItem(currFileObj.Filename) + 272 | "," + SanitizeDbItem(currFileObj!.Title) + 273 | "," + ((currFileObj?.Season is null) ? -1 : currFileObj.Season) + 274 | "," + ((currFileObj?.Episode is null) ? -1 : currFileObj.Episode) + 275 | "," + SanitizeDbItem(currFileObj!.SeriesOverview) + 276 | "," + SanitizeDbItem(currFileObj!.ImageURL) + 277 | "," + SanitizeDbItem(currFileObj.ItemID) + 278 | "," + SanitizeDbItem(currFileObj!.PosterPath) + 279 | "," + SanitizeDbItem(currFileObj.Type) + 280 | "," + SanitizeDbItem(currFileObj!.PremiereYear) + 281 | "," + ((currFileObj?.RunTime is null) ? -1 : currFileObj.RunTime) + 282 | "," + SanitizeDbItem(currFileObj!.OfficialRating) + 283 | "," + ((currFileObj?.CommunityRating is null) ? -1 : currFileObj.CommunityRating) + 284 | ");"); 285 | logger.Debug("Complete!"); 286 | } 287 | } 288 | else 289 | { 290 | logger.Debug("\"" + currFileObj.Filename + "\" has already been processed either by Previous or Current Newsletter!"); 291 | } 292 | } 293 | } 294 | } 295 | 296 | private JsonFileObj NoNull(JsonFileObj currFileObj) 297 | { 298 | if (currFileObj.Filename == null) 299 | { 300 | currFileObj.Filename = string.Empty; 301 | } 302 | 303 | if (currFileObj.Title == null) 304 | { 305 | currFileObj.Title = string.Empty; 306 | } 307 | 308 | if (currFileObj.SeriesOverview == null) 309 | { 310 | currFileObj.SeriesOverview = string.Empty; 311 | } 312 | 313 | if (currFileObj.ImageURL == null) 314 | { 315 | currFileObj.ImageURL = string.Empty; 316 | } 317 | 318 | if (currFileObj.ItemID == null) 319 | { 320 | currFileObj.Filename = string.Empty; 321 | } 322 | 323 | if (currFileObj.PosterPath == null) 324 | { 325 | currFileObj.PosterPath = string.Empty; 326 | } 327 | 328 | return currFileObj; 329 | } 330 | 331 | private bool InDatabase(string tableName, string fileName) 332 | { 333 | foreach (var row in db.Query("SELECT COUNT(*) FROM " + tableName + " WHERE Filename='" + fileName + "';")) 334 | { 335 | if (row is not null) 336 | { 337 | if (int.Parse(row[0].ToString(), CultureInfo.CurrentCulture) > 0) 338 | { 339 | logger.Debug(tableName + " Size: " + row[0].ToString()); 340 | return true; 341 | } 342 | } 343 | } 344 | 345 | return false; 346 | } 347 | 348 | private string SetImageURL(JsonFileObj currObj) 349 | { 350 | JsonFileObj fileObj; 351 | string currTitle = currObj.Title.Replace("'", string.Empty, StringComparison.Ordinal); 352 | 353 | // check if URL for series already exists CurrRunData table 354 | foreach (var row in db.Query("SELECT * FROM CurrRunData;")) 355 | { 356 | if (row is not null) 357 | { 358 | fileObj = jsonHelper.ConvertToObj(row); 359 | if ((fileObj is not null) && (fileObj.Title == currTitle) && (fileObj.ImageURL.Length > 0)) 360 | { 361 | logger.Debug("Found Current Scan of URL for " + currTitle + " :: " + fileObj.ImageURL); 362 | return fileObj.ImageURL; 363 | } 364 | } 365 | } 366 | 367 | // check if URL for series already exists CurrNewsletterData table 368 | logger.Debug("Checking if exists in CurrNewsletterData"); 369 | foreach (var row in db.Query("SELECT * FROM CurrNewsletterData;")) 370 | { 371 | if (row is not null) 372 | { 373 | fileObj = jsonHelper.ConvertToObj(row); 374 | if ((fileObj is not null) && (fileObj.Title == currTitle) && (fileObj.ImageURL.Length > 0)) 375 | { 376 | logger.Debug("Found Current Scan of URL for " + currTitle + " :: " + fileObj.ImageURL); 377 | return fileObj.ImageURL; 378 | } 379 | } 380 | } 381 | 382 | // check if URL for series already exists ArchiveData table 383 | foreach (var row in db.Query("SELECT * FROM ArchiveData;")) 384 | { 385 | if (row is not null) 386 | { 387 | fileObj = jsonHelper.ConvertToObj(row); 388 | if ((fileObj is not null) && (fileObj.Title == currTitle) && (fileObj.ImageURL.Length > 0)) 389 | { 390 | logger.Debug("Found Current Scan of URL for " + currTitle + " :: " + fileObj.ImageURL); 391 | return fileObj.ImageURL; 392 | } 393 | } 394 | } 395 | 396 | logger.Debug("Uploading poster..."); 397 | logger.Debug(currObj.ItemID); 398 | logger.Debug(currObj.PosterPath); 399 | // return string.Empty; 400 | return imageHandler.FetchImagePoster(currObj); 401 | } 402 | 403 | private void CopyCurrRunDataToNewsletterData() 404 | { 405 | // -> copy CurrData Table to NewsletterDataTable 406 | // -> clear CurrData table 407 | db.ExecuteSQL("INSERT INTO CurrNewsletterData SELECT * FROM CurrRunData;"); 408 | db.ExecuteSQL("DELETE FROM CurrRunData;"); 409 | } 410 | 411 | private string SanitizeDbItem(string unsanitized_string) 412 | { 413 | // string sanitize_string = string.Empty; 414 | if (unsanitized_string is null) 415 | { 416 | unsanitized_string = string.Empty; 417 | } 418 | 419 | return "'" + unsanitized_string.Replace("'", string.Empty, StringComparison.Ordinal) + "'"; 420 | } 421 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/ScheduledTasks/EmailNewsletterTask.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS1591 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using Jellyfin.Plugin.Newsletters.Emails.EMAIL; 8 | using MediaBrowser.Controller.Library; 9 | using MediaBrowser.Model.Globalization; 10 | using MediaBrowser.Model.Tasks; 11 | 12 | namespace Jellyfin.Plugin.Newsletters.ScheduledTasks 13 | { 14 | /// 15 | /// Class RefreshMediaLibraryTask. 16 | /// 17 | public class EmailNewsletterTask : IScheduledTask 18 | { 19 | /// 20 | public string Name => "Email Newsletter"; 21 | 22 | /// 23 | public string Description => "Email Newsletters"; 24 | 25 | /// 26 | public string Category => "Newsletters"; 27 | 28 | /// 29 | public string Key => "EmailNewsletters"; 30 | 31 | /// 32 | /// Creates the triggers that define when the task will run. 33 | /// 34 | /// IEnumerable{BaseTaskTrigger}. 35 | public IEnumerable GetDefaultTriggers() 36 | { 37 | yield return new TaskTriggerInfo 38 | { 39 | Type = TaskTriggerInfo.TriggerInterval, 40 | IntervalTicks = TimeSpan.FromHours(168).Ticks 41 | }; 42 | } 43 | 44 | /// 45 | public Task ExecuteAsync(IProgress progress, CancellationToken cancellationToken) 46 | { 47 | cancellationToken.ThrowIfCancellationRequested(); 48 | progress.Report(0); 49 | 50 | Smtp mySmtp = new Smtp(); 51 | mySmtp.SendEmail(); 52 | progress.Report(100); 53 | return Task.CompletedTask; 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/ScheduledTasks/ScanLibraryTask.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable CS1591 2 | 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using Jellyfin.Plugin.Newsletters.Scripts.SCRAPER; 8 | using MediaBrowser.Controller.Library; 9 | using MediaBrowser.Model.Globalization; 10 | using MediaBrowser.Model.Tasks; 11 | 12 | namespace Jellyfin.Plugin.Newsletters.ScheduledTasks 13 | { 14 | /// 15 | /// Class RefreshMediaLibraryTask. 16 | /// 17 | public class ScanLibraryTask : IScheduledTask 18 | { 19 | private readonly ILibraryManager _libraryManager; 20 | 21 | public ScanLibraryTask(ILibraryManager libraryManager) 22 | { 23 | _libraryManager = libraryManager; 24 | } 25 | 26 | /// 27 | public string Name => "Filesystem Scraper"; 28 | 29 | /// 30 | public string Description => "Gather info on recently added media and store it for Newsletters"; 31 | 32 | /// 33 | public string Category => "Newsletters"; 34 | 35 | /// 36 | public string Key => "EmailNewsletters"; 37 | 38 | /// 39 | /// Creates the triggers that define when the task will run. 40 | /// 41 | /// IEnumerable{BaseTaskTrigger}. 42 | public IEnumerable GetDefaultTriggers() 43 | { 44 | yield return new TaskTriggerInfo 45 | { 46 | Type = TaskTriggerInfo.TriggerInterval, 47 | IntervalTicks = TimeSpan.FromHours(1).Ticks 48 | }; 49 | } 50 | 51 | /// 52 | public Task ExecuteAsync(IProgress progress, CancellationToken cancellationToken) 53 | { 54 | cancellationToken.ThrowIfCancellationRequested(); 55 | progress.Report(0); 56 | 57 | Scraper myScraper = new Scraper(_libraryManager, progress, cancellationToken); 58 | return myScraper.GetSeriesData(); 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Shared/Database/SQLiteDatabase.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591, CA1304 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using Jellyfin.Plugin.Newsletters.Configuration; 6 | using Jellyfin.Plugin.Newsletters.LOGGER; 7 | using Jellyfin.Plugin.Newsletters.Scripts.ENTITIES; 8 | using MediaBrowser.Common.Configuration; 9 | using SQLitePCL; 10 | using SQLitePCL.pretty; 11 | 12 | namespace Jellyfin.Plugin.Newsletters.Shared.DATA; 13 | 14 | public class SQLiteDatabase 15 | { 16 | private readonly PluginConfiguration config; 17 | private string dbFilePath; 18 | private string dbLockPath; 19 | private Logger logger; 20 | private SQLiteDatabaseConnection? _db; 21 | // private bool writeLock; 22 | 23 | public SQLiteDatabase() 24 | { 25 | logger = new Logger(); 26 | config = Plugin.Instance!.Configuration; 27 | SQLite3.EnableSharedCache = false; 28 | 29 | _ = raw.sqlite3_config(raw.SQLITE_CONFIG_MEMSTATUS, 0); 30 | 31 | _ = raw.sqlite3_config(raw.SQLITE_CONFIG_MULTITHREAD, 1); 32 | 33 | _ = raw.sqlite3_enable_shared_cache(1); 34 | 35 | ThreadSafeMode = raw.sqlite3_threadsafe(); 36 | dbFilePath = config.DataPath + "/newsletters.db"; // get directory from config 37 | dbLockPath = dbFilePath + ".lock"; 38 | } 39 | 40 | internal static int ThreadSafeMode { get; set; } 41 | 42 | public void CreateConnection() 43 | { 44 | if (!File.Exists(dbLockPath)) // Database is not locked 45 | { 46 | logger.Debug("Opening Database: " + dbFilePath); 47 | _db = SQLite3.Open(dbFilePath); 48 | File.WriteAllText(dbLockPath, string.Empty); 49 | InitDatabaase(); 50 | // writeLock = true; 51 | } 52 | else 53 | { 54 | logger.Debug("Database lock file shows database is in use: " + dbLockPath); 55 | } 56 | 57 | // Example of looping through query, creating 58 | // foreach (var row in Query("SELECT * FROM CurrRunData")) 59 | // { 60 | // if (row is not null) 61 | // { 62 | // JsonFileObj helper = new JsonFileObj(); 63 | // JsonFileObj newObj = helper.ConvertToObj(row); 64 | // logger.Debug("NewObj: " + newObj.Filename); 65 | // logger.Debug("Title: " + newObj.Title); 66 | // // logger.Debug(row[0]); 67 | // } 68 | // } 69 | } 70 | 71 | private void InitDatabaase() 72 | { 73 | // Filename = string.Empty; 74 | // Title = string.Empty; 75 | // Season = 0; 76 | // Episode = 0; 77 | // SeriesOverview = string.Empty; 78 | // ImageURL = string.Empty; 79 | // ItemID = string.Empty; 80 | // PosterPath = string.Empty; 81 | 82 | logger.Debug("Creating Tables..."); 83 | string[] tableNames = { "CurrRunData", "CurrNewsletterData", "ArchiveData" }; 84 | CreateTables(tableNames); 85 | logger.Debug("Done Init of tables"); 86 | } 87 | 88 | private void CreateTables(string[] tables) 89 | { 90 | foreach (string table in tables) 91 | { 92 | ExecuteSQL("create table if not exists " + table + " (" + 93 | "Filename TEXT NOT NULL," + 94 | "Title TEXT," + 95 | "Season INT," + 96 | "Episode INT," + 97 | "SeriesOverview TEXT," + 98 | "ImageURL TEXT," + 99 | "ItemID TEXT," + 100 | "PosterPath TEXT," + 101 | "Type TEXT," + 102 | // "PremiereYear TEXT" + 103 | // "RunTime INT" + 104 | // "OfficialRating TEXT" + 105 | // "CommunityRating REAL" + 106 | "PRIMARY KEY (Filename)" + 107 | ");"); 108 | 109 | // ExecuteSQL("ALTER TABLE " + table + " ADD COLUMN Type TEXT;"); 110 | // logger.Debug("Altering Table not needed since V0.6.2.0"); 111 | // continue; 112 | logger.Info($"Altering DB table: {table}"); 113 | // 114 | Dictionary new_cols = new Dictionary(); 115 | new_cols.Add("PremiereYear", "TEXT"); 116 | new_cols.Add("RunTime", "INT"); 117 | new_cols.Add("OfficialRating", "TEXT"); 118 | new_cols.Add("CommunityRating", "REAL"); 119 | 120 | foreach (KeyValuePair col in new_cols) 121 | { 122 | try 123 | { 124 | logger.Debug($"Adding Table Columns for DB updates..."); 125 | ExecuteSQL($"ALTER TABLE {table} ADD COLUMN {col.Key} {col.Value};"); 126 | } 127 | catch (SQLiteException sle) 128 | { 129 | logger.Warn(sle); 130 | } 131 | } 132 | } 133 | } 134 | 135 | public IEnumerable> Query(string query) 136 | { 137 | logger.Debug("Running Query: " + query); 138 | return _db.Query(query); 139 | } 140 | 141 | // private IStatement PrepareStatement(string query) 142 | // { 143 | // return _db.PrepareStatement(query); 144 | // } 145 | 146 | public void ExecuteSQL(string query) 147 | { 148 | logger.Debug("Executing SQL Statement: " + query); 149 | _db.Execute(query); 150 | } 151 | 152 | public void CloseConnection() 153 | { 154 | if (File.Exists(dbLockPath)) // Database is locked 155 | { 156 | logger.Debug("Closing Database: " + dbFilePath); 157 | // _db.Close(); 158 | File.Delete(dbLockPath); 159 | // logger.Debug("TYPE: " + conn.GetType()); 160 | // writeLock = true; 161 | } 162 | else 163 | { 164 | logger.Debug("Database lock file does not exist. Database is not use: " + dbLockPath); 165 | } 166 | } 167 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Shared/Entities/JsonFileObj.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.IO; 6 | using Jellyfin.Plugin.Newsletters.LOGGER; 7 | using SQLitePCL; 8 | using SQLitePCL.pretty; 9 | 10 | namespace Jellyfin.Plugin.Newsletters.Scripts.ENTITIES; 11 | 12 | public class JsonFileObj 13 | { 14 | private Logger? logger; 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public JsonFileObj() 20 | { 21 | Filename = string.Empty; 22 | Title = string.Empty; 23 | Season = 0; 24 | Episode = 0; 25 | SeriesOverview = string.Empty; 26 | ImageURL = string.Empty; 27 | ItemID = string.Empty; 28 | PosterPath = string.Empty; 29 | Type = string.Empty; 30 | PremiereYear = string.Empty; 31 | RunTime = 0; 32 | OfficialRating = string.Empty; 33 | CommunityRating = 0.0f; 34 | } 35 | 36 | public string Filename { get; set; } 37 | 38 | public string Title { get; set; } 39 | 40 | // public string Season { get; set; } 41 | 42 | public int Season { get; set; } 43 | 44 | public int Episode { get; set; } 45 | 46 | // public string Episode { get; set; } 47 | 48 | public string SeriesOverview { get; set; } 49 | 50 | public string ImageURL { get; set; } 51 | 52 | public string ItemID { get; set; } 53 | 54 | public string PosterPath { get; set; } 55 | 56 | public string Type { get; set; } 57 | 58 | public string PremiereYear { get; set; } 59 | 60 | public int RunTime { get; set; } 61 | 62 | public string OfficialRating { get; set; } 63 | 64 | public float? CommunityRating { get; set; } 65 | 66 | public JsonFileObj ConvertToObj(IReadOnlyList row) 67 | { 68 | // Filename = string.Empty; 0 69 | // Title = string.Empty; 1 70 | // Season = 0; 2 71 | // Episode = 0; 3 72 | // SeriesOverview = string.Empty; 4 73 | // ImageURL = string.Empty; 5 74 | // ItemID = string.Empty; 6 75 | // PosterPath = string.Empty; 7 76 | 77 | logger = new Logger(); 78 | JsonFileObj obj = new JsonFileObj() 79 | { 80 | Filename = row[0].ToString(), 81 | Title = row[1].ToString(), 82 | Season = int.Parse(row[2].ToString(), CultureInfo.CurrentCulture), 83 | Episode = int.Parse(row[3].ToString(), CultureInfo.CurrentCulture), 84 | SeriesOverview = row[4].ToString(), 85 | ImageURL = row[5].ToString(), 86 | ItemID = row[6].ToString(), 87 | PosterPath = row[7].ToString(), 88 | Type = row[8].ToString(), 89 | PremiereYear = row[9].ToString(), 90 | RunTime = string.IsNullOrEmpty(row[10].ToString()) ? 0 : int.Parse(row[10].ToString(), CultureInfo.CurrentCulture), 91 | OfficialRating = row[11].ToString(), 92 | CommunityRating = string.IsNullOrEmpty(row[12].ToString()) ? 0.0f : float.Parse(row[12].ToString(), CultureInfo.CurrentCulture) 93 | }; 94 | 95 | return obj; 96 | } 97 | 98 | public Dictionary GetReplaceDict() 99 | { 100 | Dictionary item_dict = new Dictionary(); 101 | item_dict.Add("{Filename}", this.Filename); 102 | item_dict.Add("{Title}", this.Title); 103 | item_dict.Add("{Season}", this.Season); 104 | item_dict.Add("{Episode}", this.Episode); 105 | item_dict.Add("{SeriesOverview}", this.SeriesOverview); 106 | item_dict.Add("{ImageURL}", this.ImageURL); 107 | item_dict.Add("{ItemID}", this.ItemID); 108 | item_dict.Add("{PosterPath}", this.PosterPath); 109 | item_dict.Add("{Type}", this.Type); 110 | item_dict.Add("{PremiereYear}", this.PremiereYear); 111 | item_dict.Add("{RunTime}", this.RunTime); 112 | item_dict.Add("{OfficialRating}", this.OfficialRating); 113 | item_dict!.Add("{CommunityRating}", this.CommunityRating); 114 | 115 | return item_dict; 116 | } 117 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Shared/Entities/NlDetailsJson.cs: -------------------------------------------------------------------------------- 1 | #pragma warning disable 1591 2 | namespace Jellyfin.Plugin.Newsletters.Scripts.ENTITIES; 3 | 4 | public class NlDetailsJson 5 | { 6 | /// 7 | /// Initializes a new instance of the class. 8 | /// 9 | public NlDetailsJson() 10 | { 11 | Title = string.Empty; 12 | Season = 0; 13 | Episode = 0; 14 | EpisodeRange = string.Empty; 15 | } 16 | 17 | public string Title { get; set; } 18 | 19 | public int Season { get; set; } 20 | 21 | public int Episode { get; set; } 22 | 23 | public string EpisodeRange { get; set; } 24 | } -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/templateBody.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 20 | 21 |
6 | 7 | 8 | 14 | 15 | 16 | {EntryData} 17 | 18 |
9 | 10 |

Jellyfin Newsletter

11 |

{Date}

12 |
13 |
19 |
22 |
23 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/templateBodyFull.html.bak: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 40 | 41 |
6 | 7 | 8 | 11 | 12 | 13 | 14 | 17 | 24 | 25 | 26 | 29 | 36 | 37 | 38 |
9 |

Jellyfin Newsletter

10 |
15 | 16 | 18 |

19 |

Season XX - Episode[s] X-XX
20 |
21 |
My Hero Academia is such an awesome show! I hope everyone enjoys it as much as I do!!!
22 |

23 |
27 | 28 | 30 |

31 |

Season XX - Episode[s] X-XX
32 |
33 |
My Hero Academia is such an awesome show! I hope everyone enjoys it as much as I do!!!
34 |

35 |
39 |
42 |
43 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/templateBodyWithEntries.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 45 | 46 |
6 | 7 | 8 | 14 | 15 | 16 | 17 | 20 | 28 | 29 | 30 | 33 | 41 | 42 | 43 |
9 | 10 |

Jellyfin Newsletter

11 |

2023-03-14

12 |
13 |
18 | 19 | 21 |

22 |

{Title}

23 |
{SeasonEpsInfo}
24 |
25 |
{SeriesOverview}
26 |

27 |
31 | 32 | 34 |

35 |

My Hero Academia

36 |
Season 1 - Eps. 1-12
37 |
38 |
My Hero Academia is such an awesome show! I hope everyone enjoys it as much as I do!!!
39 |

40 |
44 |
47 |
48 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/templateEntry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

7 |

8 |

9 | {Title} 10 |

11 |
12 |
13 | {SeasonEpsInfo} 14 |
15 |
16 |
17 | {SeriesOverview} 18 |
19 | 20 |

21 | 22 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/template_modern_body.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 26 | 27 |
7 | 8 | 9 | 18 | 19 | 20 | 21 | {EntryData} 22 | 23 | 24 |
10 |

11 | 12 | 13 | Jellyfin Newsletter 14 | 15 |

16 |

{Date}

17 |
25 |
28 |
29 | 30 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/template_modern_entry.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 54 | 55 |
6 | 7 | 9 | 14 | 15 | 16 | 17 | 22 | 27 | 32 | 37 | 42 |
18 |
19 | Duration: {RunTime} min. | 20 |
21 |
23 |
24 | 25 |
26 |
28 |
29 | {CommunityRating} | 30 |
31 |
33 |
34 | {OfficialRating} | 35 |
36 |
38 |
39 | {PremiereYear} 40 |
41 |
43 | 44 | 45 | 46 |
47 | {SeasonEpsInfo} 48 |
49 |
50 |
51 | {SeriesOverview} 52 |
53 |
56 | 57 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/Templates/template_modern_full.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 75 | 76 |
7 | 8 | 9 | 13 | 14 | 15 | 16 | 71 | 72 | 73 |
10 |

Jellyfin Newsletter

11 |

{Date}

12 |
17 | 18 | 19 | 22 | 68 | 69 |
20 | 21 | 23 | 28 | 29 | 30 | 31 | 36 | 41 | 46 | 51 | 56 |
32 |
33 | Duration: {RunTime} min. | 34 |
35 |
37 |
38 | 39 |
40 |
42 |
43 | {CommunityRating} | 44 |
45 |
47 |
48 | {OfficialRating} | 49 |
50 |
52 |
53 | {PremiereYear} 54 |
55 |
57 | 58 | 59 | 60 |
61 | {SeasonEpsInfo} 62 |
63 |
64 |
65 | {SeriesOverview} 66 |
67 |
70 |
74 |
77 |
78 | 79 | -------------------------------------------------------------------------------- /Jellyfin.Plugin.Newsletters/manifest.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "guid": "60f478ab-2dd6-4ea0-af10-04d033f75979", 4 | "name": "Newsletters", 5 | "description": "This plugin automacially scans a users library (default every 4 hours), populates a list of recently added (not previously scanned) media, converts that data into HTML format, and sends out emails to a provided list of recipients.", 6 | "overview": "Send newsletters for recently added media", 7 | "owner": "jellyfin", 8 | "category": "General", 9 | "imageUrl": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/logo.png", 10 | "versions": [ 11 | { 12 | "version": "0.6.4.2", 13 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. - Minor bug fix post 0.6.3.0 release FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 14 | "targetAbi": "10.9.0.0", 15 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.4.2/newsletters_0.6.4.2.zip", 16 | "checksum": "ad40b13a72bea4619b1d1d93ead0c738", 17 | "timestamp": "2024-05-19T05:17:53Z" 18 | }, 19 | { 20 | "version": "0.6.4.1", 21 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. - Minor bug fix post 0.6.3.0 release FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 22 | "targetAbi": "10.9.0.0", 23 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.4.1/newsletters_0.6.4.1.zip", 24 | "checksum": "85b8abcf453b85e53c3798ca68cf3f60", 25 | "timestamp": "2024-05-19T05:02:03Z" 26 | }, 27 | { 28 | "version": "0.6.4.0", 29 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. - Minor bug fix post 0.6.3.0 release FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 30 | "targetAbi": "10.9.0.0", 31 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.4.0/newsletters_0.6.4.0.zip", 32 | "checksum": "30d9f25be49a611327d851bb644bdc58", 33 | "timestamp": "2024-05-19T04:11:46Z" 34 | }, 35 | { 36 | "version": "0.6.3.0", 37 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 38 | "targetAbi": "10.9.0.0", 39 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.3.0/newsletters_0.6.3.0.zip", 40 | "checksum": "a9ade0fc92ae888fdf9bf482c9260bdd", 41 | "timestamp": "2024-05-19T04:04:44Z" 42 | }, 43 | { 44 | "version": "0.6.2.1", 45 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 46 | "targetAbi": "10.9.0.0", 47 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.2.1/Newsletters-v0.6.2.1.zip", 48 | "checksum": "e64109db29c1850c023e3c54e59ab771", 49 | "timestamp": "2024-05-16T05:00:00Z" 50 | }, 51 | { 52 | "version": "0.6.2.0", 53 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 54 | "targetAbi": "10.9.0.0", 55 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.2.0/Newsletters-v0.6.2.0.zip", 56 | "checksum": "ebac6c81cc4d1a506678d89d099ae2e5", 57 | "timestamp": "2024-05-13T05:00:00Z" 58 | }, 59 | { 60 | "version": "0.6.0.0", 61 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 62 | "targetAbi": "10.8.0.0", 63 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.0/Newsletters-v0.6.0.zip", 64 | "checksum": "07305d7733f4103b9099c3c4d96d02a6", 65 | "timestamp": "2023-08-10T05:00:00Z" 66 | }, 67 | { 68 | "version": "0.5.1.0", 69 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 70 | "targetAbi": "10.8.0.0", 71 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.5.1/Newsletters-v0.5.1.zip", 72 | "checksum": "701f3f7f8876041bed4d940e7f9eb150", 73 | "timestamp": "2023-07-28T15:00:00Z" 74 | }, 75 | { 76 | "version": "0.5.0.0", 77 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 78 | "targetAbi": "10.8.0.0", 79 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.5.0/Newsletters-v0.5.0.zip", 80 | "checksum": "05e80b44afbf424b53ce589a0964d04d", 81 | "timestamp": "2023-03-28T15:00:00Z" 82 | }, 83 | { 84 | "version": "0.4.0.0", 85 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 86 | "targetAbi": "10.8.0.0", 87 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.4.0/Newsletters-v0.4.0.zip", 88 | "checksum": "d68385ce38ba8929794b4ee06fdf8b21", 89 | "timestamp": "2023-03-17T20:00:00Z" 90 | }, 91 | { 92 | "version": "0.3.3.0", 93 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 94 | "targetAbi": "10.8.0.0", 95 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.3/Newsletters-v0.3.3.zip", 96 | "checksum": "30d30527c7682f94a1b2922ac2578958", 97 | "timestamp": "2023-03-17T15:00:00Z" 98 | }, 99 | { 100 | "version": "0.3.2.0", 101 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 102 | "targetAbi": "10.8.0.0", 103 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.2/Newsletters-v0.3.2.zip", 104 | "checksum": "a7b0b05359a94c7e2878b629627b7212", 105 | "timestamp": "2023-03-17T14:00:00Z" 106 | }, 107 | { 108 | "version": "0.3.1.0", 109 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 110 | "targetAbi": "10.8.0.0", 111 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.1/Newsletters-v0.3.1.zip", 112 | "checksum": "c27336a4bbc93316e02ebfdde71a0405", 113 | "timestamp": "2023-03-16T14:00:00Z" 114 | }, 115 | { 116 | "version": "0.3.0.0", 117 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 118 | "targetAbi": "10.8.0.0", 119 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.0/Newsletters-v0.3.0.zip", 120 | "checksum": "57f94cff6743d9373e2c0e803d1afb79", 121 | "timestamp": "2023-03-16T05:00:00Z" 122 | }, 123 | { 124 | "version": "0.0.5.0", 125 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 126 | "targetAbi": "10.8.0.0", 127 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.0.5/Newsletters-v0.0.5.zip", 128 | "checksum": "fa7b80975a565007a86932f08c396429", 129 | "timestamp": "2023-03-14T12:00:00Z" 130 | }, 131 | { 132 | "version": "0.0.1.0", 133 | "changelog": "- initial alpha release", 134 | "targetAbi": "10.8.0.0", 135 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.0.1/Newsletters-v0.0.1.zip", 136 | "checksum": "0f9e05f8f1e13a0f2eaadd69542a7700", 137 | "timestamp": "2023-03-10T10:00:00Z" 138 | } 139 | ] 140 | } 141 | ] 142 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /NewsletterExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/0c382440a75844a08e45a3dae13ed30d238d1eed/NewsletterExample.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jellyfin Newsletter Plugin 2 |

3 |
4 |

5 | This is my first end-to-end C# project, but I hope you enjoy! 6 | 7 | # Description 8 | This plugin automacially scans a users library (default every 4 hours), populates a list of *recently added (not previously scanned)* media, converts that data into HTML format, and sends out emails to a provided list of recipients. 9 | 10 |

11 |
12 |

13 | 14 | # Current Limitations 15 | 1. Imgur's API is one available option to upload poster images for newsletter emails to fetch images. Imgur (according to their Documentation) limits uploads to 12,500/day. 16 | - HOWEVER, according to some documentation I have just discovered, there is a limit of 500 requests/hour for each user _(IP address)_ hitting the API 17 | - **This plugin is configured to reference existing Images from previous scans (including current) as to not duplicate requests to Imgur and use up the daily upload limit** 18 | - Sign up to get an API key in order to use this plugin. 19 | - Helpful Links: 20 | - https://dev.to/bearer/how-to-configure-the-imgur-api-2ap9 21 | - http://siberiancmscustomization.blogspot.com/2020/10/how-to-get-imgur-client-id.html 22 | - ***Users can bypass this limitation as of V0.5.0 with the ability to use Jellyfin's API to serve images!*** 23 | 24 | # File Structure 25 | To ensure proper images are being pulled from Jellyfin's database, ensure you follow the standard Organization Scheme for naming and organizing your files. https://jellyfin.org/docs/general/server/media/books 26 | 27 | If this format isn't followed properly, Jellyfin may have issue correctly saving the item's data in the proper database (the database that this plugin uses). 28 | 29 | ``` 30 | Shows 31 | ├── Series (2010) 32 | │ ├── Season 00 33 | │ │ ├── Some Special.mkv 34 | │ │ ├── Episode S00E01.mkv 35 | │ │ └── Episode S00E02.mkv 36 | │ ├── Season 01 37 | │ │ ├── Episode S01E01-E02.mkv 38 | │ │ ├── Episode S01E03.mkv 39 | │ │ └── Episode S01E04.mkv 40 | │ └── Season 02 41 | │ ├── Episode S02E01.mkv 42 | │ ├── Episode S02E02.mkv 43 | │ ├── Episode S02E03 Part 1.mkv 44 | │ └── Episode S02E03 Part 2.mkv 45 | └── Series (2018) 46 | ├── Episode S01E01.mkv 47 | ├── Episode S01E02.mkv 48 | ├── Episode S02E01-E02.mkv 49 | └── Episode S02E03.mkv 50 | 51 | Movies 52 | ├── Film (1990).mp4 53 | ├── Film (1994).mp4 54 | ├── Film (2008) 55 | │ └── Film.mkv 56 | └── Film (2010) 57 | ├── Film-cd1.avi 58 | └── Film-cd2.avi 59 | ``` 60 | 61 | # Testing/Run Frequency 62 | 63 | Testing and Frequency can be managed through your Dashboard > Scheduled Tasks 64 | 65 | - There are 2 scheduled tasks: 66 | - Email Newsletter: Which generates and sends out the newsletters via email from the data scanned from the task below 67 | - Filesystem Scraper: Which scans your library, parses the data, and gets it ready for the email 68 | 69 | # Installation 70 | 71 | Manifest is up an running! You can now import the manifest in Jellyfin and this plugin will appear in the Catalog! 72 | - Go to "Plugins" on your "Dashboard" 73 | - Go to the "Repositories" tab 74 | - Click the '+' to add a new Repository 75 | - Give it a name (i.e. Newsletters) 76 | - In "Repository URL," put "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/manifest.json" 77 | - Click "Save" 78 | - You should now see Jellyfin Newsletters in Catalog under the Category "Newsletters" 79 | - Once installed, restart Jellyfin to activate the plugin and configure your settings for the plugin 80 | 81 | # Configuration 82 | 83 | ## General Config 84 | 85 | ### To Addresses: 86 | - Recipients of the newsletter. Add add as many emails as you'd like, separated by commas. 87 | - All emails will be sent out via BCC 88 | 89 | ### From Address 90 | - The address recipients will see on emails as the sender 91 | - Defaults to JellyfinNewsletter@donotreply.com 92 | 93 | ### Subject 94 | - The subject of the email 95 | 96 | ### Library Selection 97 | - Select the item types you want to scan 98 | - NOTE: this is Item types, not libraries 99 | 100 | ## Newsletter HTML Format 101 | Allows for use of custom HTML formatting for emails! Defaults to original formatting, but can be modified now! 102 | 103 | For defaults, see `Jellyfin.Plugin.Newsletters/Templates/` 104 | 105 | ### Body HTML 106 | - The main body of your email 107 | 108 | ### EntryData HTML 109 | - The formatting for each individual entry/series/movie that was found and will be sent out 110 | 111 | ## Scraper/Scanner Config 112 | 113 | ### Poster Hosting Type 114 | - The type of poster hosting you want to use 115 | - Options include: 116 | - Imgur (Default) 117 | - Local Hosting from Jellyfin's API 118 | 119 | ### Imgur API Key 120 | - Your Imgur API key (Client ID) to upload images to be available in the newsletter 121 | 122 | ### Hostname 123 | - Your servername/hostname/DNS entry (and Port if applicable) to allow users to access images hosted locally on your server. 124 | - i.e. https://myDNSentry.com:8096 125 | - **NOTE:** do not put a trailing '/' at the end of the url 126 | - This is now used as a possible data tag! (even if you don't use self-hosting, set this if you want the `{ServerURL}` to work) 127 | 128 | ## SMTP Config 129 | 130 | ### Smtp Server Address 131 | - The email server address you want to use. 132 | - Defaults to smtp.gmail.com 133 | 134 | ### Smtp Port 135 | - The port number used by the email server above 136 | - Defaults to gmail's port (587) 137 | 138 | ### Smtp Username 139 | - Your username/email to authenticate to the SMTP server above 140 | 141 | ### Smtp Password 142 | - Your password to authenticate to the SMTP server above 143 | - I'm not sure about other email servers, but google requires a Dev password to be created. 144 | - For gmail specific instructions, you can visit https://support.google.com/mail/answer/185833?hl=en for details 145 | 146 | # Issues 147 | Please leave a ticket in the Issues on this GitHub page and I will get to it as soon as I can. 148 | Please be patient with me, since I did this on the side of my normal job. But I will try to fix any issues that come up to the best of my ability and as fast as I can! 149 | 150 | # Available HTML Data Tags 151 | Some of these may not interest that average user (if anyone), but I figured I would have any element in the Newsletters.db be available for use!
152 | **NOTE:** *Examples of most tags can be found in the default Templates (template_modern_body.html AND template_modern_entry.html)* 153 | 154 | ## Required Tags 155 | ``` 156 | - {EntryData} - Needs to be inside of the 'Body' html 157 | ``` 158 | ## Recommended Tags 159 | ``` 160 | - {Date} - Auto-generated date of Newsletter email generation 161 | - {SeasonEpsInfo} - This tag is the Plugin-generated Season/Episode data 162 | - {Title} - Title of Movie/Series 163 | - {SeriesOverview} - Movie/Series overview 164 | - {ImageURL} - Poster image for the Movie/Series 165 | - {Type} - Item type (Movie or Series) 166 | - {PremiereYear} - Year Movie/Series was Premiered 167 | - {RunTime} - Movie/Episode Duration (for Series, gives first found duration. Will fix for only single episode or average in future update) 168 | - {OfficialRating} - TV-PG, TV-13, TV-14, etc. 169 | - {CommunityRating} - Numerical rating stored in Jellyfin's metadata 170 | ``` 171 | ## Non-Recommended Tags 172 | These tags are ***available*** but not recommended to use. Untested behavior using these. 173 | ``` 174 | - {Filename} - File path of the Movie/Episode (NOT RECOMMENDED TO USE) 175 | - {Season} - Season number of Episode (NOT RECOMMENDED TO USE) 176 | - {Episode} - Episode number (NOT RECOMMENDED TO USE) 177 | - {ItemID} - Jellyfin's assigned ItemID (NOT RECOMMENDED TO USE) 178 | - {PosterPath} - Jellyfin's assigned Poster Path (NOT RECOMMENDED TO USE) 179 | ``` 180 | ## Known Issues 181 | See 'issues' tab in GitHub with the lable 'bug' 182 | 183 | # Contribute 184 | If you would like to collaborate/contribute, feel free! Make all PR's to the 'development' branch and please note clearly what was added/fixed, thanks! 185 | -------------------------------------------------------------------------------- /build.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Newsletters" 3 | guid: "60f478ab-2dd6-4ea0-af10-04d033f75979" 4 | imageUrl: "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/logo.png" 5 | version: "0.6.4.2" 6 | targetAbi: "10.9.0.0" 7 | framework: "net8.0" 8 | overview: "Send newsletters for recently added media" 9 | description: "This plugin automacially scans a users library (default every 4 hours), populates a list of recently added (not previously scanned) media, converts that data into HTML format, and sends out emails to a provided list of recipients." 10 | category: "General" 11 | owner: "jellyfin" 12 | artifacts: 13 | - "Jellyfin.Plugin.Newsletters.dll" 14 | - "SQLitePCL.pretty.dll" 15 | changelog: > 16 | - Major code refactoring. 17 | - Database updates for new available Tags. 18 | - Catch all for any missed tags in newsletter output. 19 | - Alert for "Test mail" button. 20 | - Minor bug fix post 0.6.3.0 release 21 | FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md 22 | -------------------------------------------------------------------------------- /jellyfin.ruleset: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/0c382440a75844a08e45a3dae13ed30d238d1eed/logo.png -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "guid": "60f478ab-2dd6-4ea0-af10-04d033f75979", 4 | "name": "Newsletters", 5 | "description": "This plugin automacially scans a users library (default every 4 hours), populates a list of recently added (not previously scanned) media, converts that data into HTML format, and sends out emails to a provided list of recipients.", 6 | "overview": "Send newsletters for recently added media", 7 | "owner": "jellyfin", 8 | "category": "General", 9 | "imageUrl": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/logo.png", 10 | "versions": [ 11 | { 12 | "version": "0.6.4.2", 13 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. - Minor bug fix post 0.6.3.0 release FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 14 | "targetAbi": "10.9.0.0", 15 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.4.2/newsletters_0.6.4.2.zip", 16 | "checksum": "ad40b13a72bea4619b1d1d93ead0c738", 17 | "timestamp": "2024-05-19T05:17:53Z" 18 | }, 19 | { 20 | "version": "0.6.4.1", 21 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. - Minor bug fix post 0.6.3.0 release FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 22 | "targetAbi": "10.9.0.0", 23 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.4.1/newsletters_0.6.4.1.zip", 24 | "checksum": "85b8abcf453b85e53c3798ca68cf3f60", 25 | "timestamp": "2024-05-19T05:02:03Z" 26 | }, 27 | { 28 | "version": "0.6.4.0", 29 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. - Minor bug fix post 0.6.3.0 release FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 30 | "targetAbi": "10.9.0.0", 31 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.4.0/newsletters_0.6.4.0.zip", 32 | "checksum": "30d9f25be49a611327d851bb644bdc58", 33 | "timestamp": "2024-05-19T04:11:46Z" 34 | }, 35 | { 36 | "version": "0.6.3.0", 37 | "changelog": "- Major code refactoring. - Database updates for new available Tags. - Catch all for any missed tags in newsletter output. - Alert for \"Test mail\" button. FULL CHANGELOG: https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md\n", 38 | "targetAbi": "10.9.0.0", 39 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.3.0/newsletters_0.6.3.0.zip", 40 | "checksum": "a9ade0fc92ae888fdf9bf482c9260bdd", 41 | "timestamp": "2024-05-19T04:04:44Z" 42 | }, 43 | { 44 | "version": "0.6.2.1", 45 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 46 | "targetAbi": "10.9.0.0", 47 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.2.1/Newsletters-v0.6.2.1.zip", 48 | "checksum": "e64109db29c1850c023e3c54e59ab771", 49 | "timestamp": "2024-05-16T05:00:00Z" 50 | }, 51 | { 52 | "version": "0.6.2.0", 53 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 54 | "targetAbi": "10.9.0.0", 55 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.2.0/Newsletters-v0.6.2.0.zip", 56 | "checksum": "ebac6c81cc4d1a506678d89d099ae2e5", 57 | "timestamp": "2024-05-13T05:00:00Z" 58 | }, 59 | { 60 | "version": "0.6.0.0", 61 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 62 | "targetAbi": "10.8.0.0", 63 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.6.0/Newsletters-v0.6.0.zip", 64 | "checksum": "07305d7733f4103b9099c3c4d96d02a6", 65 | "timestamp": "2023-08-10T05:00:00Z" 66 | }, 67 | { 68 | "version": "0.5.1.0", 69 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 70 | "targetAbi": "10.8.0.0", 71 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.5.1/Newsletters-v0.5.1.zip", 72 | "checksum": "701f3f7f8876041bed4d940e7f9eb150", 73 | "timestamp": "2023-07-28T15:00:00Z" 74 | }, 75 | { 76 | "version": "0.5.0.0", 77 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 78 | "targetAbi": "10.8.0.0", 79 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.5.0/Newsletters-v0.5.0.zip", 80 | "checksum": "05e80b44afbf424b53ce589a0964d04d", 81 | "timestamp": "2023-03-28T15:00:00Z" 82 | }, 83 | { 84 | "version": "0.4.0.0", 85 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 86 | "targetAbi": "10.8.0.0", 87 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.4.0/Newsletters-v0.4.0.zip", 88 | "checksum": "d68385ce38ba8929794b4ee06fdf8b21", 89 | "timestamp": "2023-03-17T20:00:00Z" 90 | }, 91 | { 92 | "version": "0.3.3.0", 93 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 94 | "targetAbi": "10.8.0.0", 95 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.3/Newsletters-v0.3.3.zip", 96 | "checksum": "30d30527c7682f94a1b2922ac2578958", 97 | "timestamp": "2023-03-17T15:00:00Z" 98 | }, 99 | { 100 | "version": "0.3.2.0", 101 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 102 | "targetAbi": "10.8.0.0", 103 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.2/Newsletters-v0.3.2.zip", 104 | "checksum": "a7b0b05359a94c7e2878b629627b7212", 105 | "timestamp": "2023-03-17T14:00:00Z" 106 | }, 107 | { 108 | "version": "0.3.1.0", 109 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 110 | "targetAbi": "10.8.0.0", 111 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.1/Newsletters-v0.3.1.zip", 112 | "checksum": "c27336a4bbc93316e02ebfdde71a0405", 113 | "timestamp": "2023-03-16T14:00:00Z" 114 | }, 115 | { 116 | "version": "0.3.0.0", 117 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 118 | "targetAbi": "10.8.0.0", 119 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.3.0/Newsletters-v0.3.0.zip", 120 | "checksum": "57f94cff6743d9373e2c0e803d1afb79", 121 | "timestamp": "2023-03-16T05:00:00Z" 122 | }, 123 | { 124 | "version": "0.0.5.0", 125 | "changelog": "https://raw.githubusercontent.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/master/CHANGELOG.md", 126 | "targetAbi": "10.8.0.0", 127 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.0.5/Newsletters-v0.0.5.zip", 128 | "checksum": "fa7b80975a565007a86932f08c396429", 129 | "timestamp": "2023-03-14T12:00:00Z" 130 | }, 131 | { 132 | "version": "0.0.1.0", 133 | "changelog": "- initial alpha release", 134 | "targetAbi": "10.8.0.0", 135 | "sourceUrl": "https://github.com/Cloud9Developer/Jellyfin-Newsletter-Plugin/releases/download/v0.0.1/Newsletters-v0.0.1.zip", 136 | "checksum": "0f9e05f8f1e13a0f2eaadd69542a7700", 137 | "timestamp": "2023-03-10T10:00:00Z" 138 | } 139 | ] 140 | } 141 | ] 142 | --------------------------------------------------------------------------------