Skip to content

Commit

Permalink
Moved Tags to ComicInfo (so it's saved in comicinfo.xml)
Browse files Browse the repository at this point in the history
  • Loading branch information
maforget committed Jan 31, 2024
1 parent fe8bcba commit 51d1162
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
15 changes: 0 additions & 15 deletions ComicRack.Engine/ComicBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,21 +400,6 @@ public float Rating
}
}

[Browsable(true)]
[DefaultValue("")]
[ResetValue(0)]
public string Tags
{
get
{
return tags;
}
set
{
SetProperty("Tags", ref tags, value);
}
}

[DefaultValue(typeof(BitmapAdjustment), "Empty")]
public BitmapAdjustment ColorAdjustment
{
Expand Down
31 changes: 27 additions & 4 deletions ComicRack.Engine/ComicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public class ComicInfo

private string scanInformation = string.Empty;

private string tags = string.Empty;

private volatile int cachedFrontCoverPageIndex = -1;

private volatile int cachedFrontCoverCount = -1;
Expand Down Expand Up @@ -756,7 +758,23 @@ public string ScanInformation
}
}

public int FrontCoverPageIndex
[Browsable(true)]
[Searchable]
[DefaultValue("")]
[ResetValue(0)]
public string Tags
{
get
{
return tags;
}
set
{
SetProperty("Tags", ref tags, value);
}
}

public int FrontCoverPageIndex
{
get
{
Expand Down Expand Up @@ -1276,7 +1294,11 @@ public virtual void SetInfo(ComicInfo ci, bool onlyUpdateEmpty = true, bool upda
{
Number = ci.Number;
}
if (!onlyUpdateEmpty || Count == -1)
if (!onlyUpdateEmpty || string.IsNullOrEmpty(Tags))
{
Tags = ci.Tags;
}
if (!onlyUpdateEmpty || Count == -1)
{
Count = ci.Count;
}
Expand Down Expand Up @@ -1389,7 +1411,8 @@ public ComicInfo GetInfo()
Characters = Characters,
Teams = Teams,
Locations = Locations,
ScanInformation = ScanInformation
ScanInformation = ScanInformation,
Tags = Tags,
};
Pages.ForEach(delegate(ComicPageInfo cpi)
{
Expand All @@ -1401,7 +1424,7 @@ public ComicInfo GetInfo()

public bool IsSameContent(ComicInfo ci, bool withPages = true)
{
if (ci != null && ci.Writer == Writer && ci.Publisher == Publisher && ci.Imprint == Imprint && ci.Inker == Inker && ci.Penciller == Penciller && ci.Title == Title && ci.Number == Number && ci.Count == Count && ci.Summary == Summary && ci.Series == Series && ci.Volume == Volume && ci.AlternateSeries == AlternateSeries && ci.AlternateNumber == AlternateNumber && ci.AlternateCount == AlternateCount && ci.StoryArc == StoryArc && ci.SeriesGroup == SeriesGroup && ci.Year == Year && ci.Month == Month && ci.Day == Day && ci.Notes == Notes && ci.Review == Review && ci.Genre == Genre && ci.Colorist == Colorist && ci.Editor == Editor && ci.Letterer == Letterer && ci.CoverArtist == CoverArtist && ci.Web == Web && ci.LanguageISO == LanguageISO && ci.PageCount == PageCount && ci.Format == Format && ci.AgeRating == AgeRating && ci.BlackAndWhite == BlackAndWhite && ci.Manga == Manga && ci.Characters == Characters && ci.Teams == Teams && ci.MainCharacterOrTeam == MainCharacterOrTeam && ci.Locations == Locations && ci.ScanInformation == ScanInformation)
if (ci != null && ci.Writer == Writer && ci.Publisher == Publisher && ci.Imprint == Imprint && ci.Inker == Inker && ci.Penciller == Penciller && ci.Title == Title && ci.Number == Number && ci.Count == Count && ci.Summary == Summary && ci.Series == Series && ci.Volume == Volume && ci.AlternateSeries == AlternateSeries && ci.AlternateNumber == AlternateNumber && ci.AlternateCount == AlternateCount && ci.StoryArc == StoryArc && ci.SeriesGroup == SeriesGroup && ci.Year == Year && ci.Month == Month && ci.Day == Day && ci.Notes == Notes && ci.Review == Review && ci.Genre == Genre && ci.Colorist == Colorist && ci.Editor == Editor && ci.Letterer == Letterer && ci.CoverArtist == CoverArtist && ci.Web == Web && ci.LanguageISO == LanguageISO && ci.PageCount == PageCount && ci.Format == Format && ci.AgeRating == AgeRating && ci.BlackAndWhite == BlackAndWhite && ci.Manga == Manga && ci.Characters == Characters && ci.Teams == Teams && ci.MainCharacterOrTeam == MainCharacterOrTeam && ci.Locations == Locations && ci.ScanInformation == ScanInformation && ci.Tags == Tags)
{
if (withPages)
{
Expand Down

0 comments on commit 51d1162

Please sign in to comment.