mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
refactor(newsletter): ♻️ Media servers + newsletter refactoring (#4463)
* Abstract media servers content into interfaces * Media server entities into abstract classes * Abstract media server content repository * First pass at newsletter refactoring * Minor code clean up * Attempt at abstracting repositories (WIP) * Fixed cast issue * Corrected the other properties * A step towards newsletter refactoring * Clean up leftovers * Fix broken episodes db interaction * Save absolute URL for Plex content Let's be consistent with Emby and Jellyfin * Fix broken integration with Plex libraries * Fix error when multiple media servers configured * Fix newsletter being sent if no movies or episodes * Fix broken tests * Remove unneccesary logs * Expose stored media server URL No need to recalculate it + Plex URL was broken due to an earlier change * Remove unused variable * Remove obsolete tests URLs are now fetched from database directly * Retro-compatibility for Plex content URL Solves URL for media synced before absolute URL was saved in PlexServerContent * chore: added some obsoletes * fix: removed the unsub link when not present Co-authored-by: tidusjar <tidusjar@gmail.com>
This commit is contained in:
parent
32ee4e88ec
commit
0ff0a704ff
46 changed files with 595 additions and 1148 deletions
|
@ -30,6 +30,7 @@ namespace Ombi.Notifications.Templates
|
|||
private const string TableLocation = "{@RECENTLYADDED}";
|
||||
private const string IntroText = "{@INTRO}";
|
||||
private const string Unsubscribe = "{@UNSUBSCRIBE}";
|
||||
private const string UnsubscribeText = "{@UNSUBSCRIBETEXT}";
|
||||
|
||||
|
||||
public string LoadTemplate(string subject, string intro, string tableHtml, string logo, string unsubscribeLink)
|
||||
|
@ -41,6 +42,7 @@ namespace Ombi.Notifications.Templates
|
|||
sb.Replace(DateKey, DateTime.Now.ToString("f"));
|
||||
sb.Replace(Logo, string.IsNullOrEmpty(logo) ? OmbiLogo : logo);
|
||||
sb.Replace(Unsubscribe, string.IsNullOrEmpty(unsubscribeLink) ? string.Empty : unsubscribeLink);
|
||||
sb.Replace(UnsubscribeText, string.IsNullOrEmpty(unsubscribeLink) ? string.Empty : "Unsubscrible");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
|
|
@ -453,7 +453,7 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<td class="content-block powered-by" valign="top" align="center" style="font-family: sans-serif; vertical-align: top; padding-bottom: 10px; padding-top: 10px; color: #999999; font-size: 12px; text-align: center;">
|
||||
<a href="{@UNSUBSCRIBE}" style="font-weight: 400; font-size: 12px; text-align: center; color: #ff761b;">Unsubscribe</a>
|
||||
<a href="{@UNSUBSCRIBE}" style="font-weight: 400; font-size: 12px; text-align: center; color: #ff761b;">{@UNSUBSCRIBETEXT}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue