mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
* Readme refactored to be more clean and clear, taking inspiration from wiki.js's readme. * Initial backend for Collections and basic metadata implemented. * More build flavors for Raspberry Pi users and updated Install since we don't need users to set their own JWT Token Key. Update a typo in appsettings.json file for prod. * Fixed #224. Sort before getting a First?Last() chatper * The rough ability to add and get series metadata and tags. * Fix a bug on getting metadata for when it doesn't exist. * Fixed a bug where flattening directories with some unique filenames could cause reading order of images to be out of order. * Added a seed code to ensure all series have SeriesMetdata * Ensure all instances of opening an epub is using "using" so we don't lock the file. When we have a malformed html file, log the issues and inform the user we can't open the file. * Book reader now handles @Import "" statements in CSS and inlines the css into css file that references them. This allows for them to be scoped. In addition, if the html or body tag had classes, we now send back a single div with those classes. * Fixed GetSeriesDtoForCollectionAsync which was not properly returning series * Implemented cover image for collection tag. Fixed an issue in metadata update call. * Add check for user access when resolving series for a collection tag. When asking for all tags, if the user is not an admin, only give promotoed tags back. * Implemented updateTag api * Implemented the ability to update series the tags have access to. * Cleanup, sorting, and null check * More sorting changes * Ensure we can delete tags when editing a series tags * Fix order of update to make sure a tag is properly deleted * Code smells
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using API.Entities.Interfaces;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace API.Entities
|
|
{
|
|
/// <summary>
|
|
/// Represents a user entered field that is used as a tagging and grouping mechanism
|
|
/// </summary>
|
|
[Index(nameof(Id), nameof(Promoted), IsUnique = true)]
|
|
public class CollectionTag : IHasConcurrencyToken
|
|
{
|
|
public int Id { get; set; }
|
|
/// <summary>
|
|
/// Visible title of the Tag
|
|
/// </summary>
|
|
public string Title { get; set; }
|
|
|
|
/// <summary>
|
|
/// Cover Image for the collection tag
|
|
/// </summary>
|
|
public byte[] CoverImage { get; set; }
|
|
|
|
/// <summary>
|
|
/// A description of the tag
|
|
/// </summary>
|
|
public string Summary { get; set; }
|
|
|
|
/// <summary>
|
|
/// A normalized string used to check if the tag already exists in the DB
|
|
/// </summary>
|
|
public string NormalizedTitle { get; set; }
|
|
/// <summary>
|
|
/// A promoted collection tag will allow all linked seriesMetadata's Series to show for all users.
|
|
/// </summary>
|
|
public bool Promoted { get; set; }
|
|
|
|
public ICollection<SeriesMetadata> SeriesMetadatas { get; set; }
|
|
|
|
|
|
[ConcurrencyCheck]
|
|
public uint RowVersion { get; set; }
|
|
|
|
public void OnSavingChanges()
|
|
{
|
|
RowVersion++;
|
|
}
|
|
}
|
|
} |