Welcome, Guest
Python Scripts for ComicRack

TOPIC: [Script] Same X different Y - Smart List Script (ver 0.7 18/10/17)

[Script] Same X different Y - Smart List Script (ver 0.7 18/10/17) 1 year 1 month ago #46485

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
So... After some beta testing (thanks all who helped) I upload the "not beta anymore" version of this script, this time well packaged for easy installing :)

Version 0.7 (last updated version)

File Attachment:

File Name: SameXDiffe...crplugin
File Size:3 KB


It works the following way... First you put how to group comics by X (Format, SeriesGroup, etc) and then find differences of Y (Format, SeriesGroup, etc) to filter the groups found...

In short, you read the script like this: I want all comics that have the same "first text camp" but that have different "second text camp"

(If multiple attributes, first text camp is with AND, the second is with OR)

You can group and filter for more than one attribute at the same time with separator | (in case of X, it will divide the groups into any combination of values it find, in case of Y, it will search for differences in ANY attribute it has to filter the groups)

Remember this script filter by group... that means, if a comic in a group has the difference (or differences) you are looking for, the entire group will be returned as result (as made by the X attributes combinations)

You can also use custom values (useful for comicvine id values)


So, for example, if you want to find comics volumes with different SeriesGroup in the same Volume
(first text camp) = Series|Volume (You group your comics by Series and Volume)
(second text camp) = SeriesGroup (You filter GROUPS so that only ones with more than one SeriesGroup are shown)


Other example would be to find comics in your collection with the same comicvine issue id:
(first text camp) = comicvine_issue (You group your comics by comicvine issue id)
(second text camp) = (if you don't filter by anything, the script will only filter groups with less than 2 comics)


Other example for verifying that there is no comics with the same comicvine volume id and different format:
(first text camp) = comicvine_volume (You group your comics by comicvine volume id)
(second text camp) = Format (you filter those volume groups with different formats)

Or a custom duplicate finder:
(first text camp) = Series|Volume|Title (In this case any 2 or more comics who has same Series Volume and Title)
(second text camp) =

You can use any default attribute in the Comicrack Documentation, or any custom attribute your comics have :P (remember to use Capitals correctly)

I found a lot of uses for this script in my collection, I hope it helps others too :)

If you find any bug or something you want to modify or add, make me know!

ps: You can use as many attributes in each text camp as you want ( at least while you can write them in the text camp), but remember that if you use many attributes in X it will use a huge list of comic groups... that means time and memory...

Versions:
0.1 First version, it seems to work :)
0.2 Added custom values support and better handling of non existent attributes
0.3 Added possibility to add more than one attribute in X and Y (with | to separate) and better handling of exceptions
0.4 Fixed handling of non existent attributes
0.5 Fixed problem with unicode characters in values (which gave false positives)
0.6 Added "similar" option with ! character
0.7 Improved performance, clearer code
Last Edit: 1 month 3 weeks ago by Xelloss.
The administrator has disabled public write access.
The following user(s) said Thank You: perezmu, rmagere, romsnesrom, jkthemac, ChrisR

[Script] Same X different Y - Smart List Script 1 year 1 month ago #46490

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
I add a list of all Attributes a comic has... Most of them you can use for this script (some are pointers and some of them I have no idea what they are XD)

'AddedTime'
'AddedTimeAsText'
'AgeRating'
'AgeRatingIcons'
'AlternateCaption'
'AlternateCount'
'AlternateCountAsText'
'AlternateNumber'
'AlternateNumberAsText'
'AlternateSeries'
'AppendArtistInfo'
'ArtistInfo'
'BlackAndWhite'
'BlackAndWhiteAsText'
'BookAge'
'BookChanged'
'BookCollectionStatus'
'BookCondition'
'BookLocation'
'BookNotes'
'BookOwner'
'BookPrice'
'BookPriceAsText'
'BookStore'
'BookmarkCount'
'BookmarkCountAsText'
'Bookmarks'
'Caption'
'CaptionWithoutFormat'
'CaptionWithoutTitle'
'Characters'
'Checked'
'ClearBookmarks'
'ClearExtraSyncInformation'
'ClipboardFormat'
'Clone'
'ColorAdjustment'
'ColorAdjustmentSpecified'
'Colorist'
'ComicInfoIsDirty'
'ComicProviderCreated'
'CommunityRating'
'CommunityRatingAsText'
'CompareAlternateNumber'
'CompareNumber'
'Container'
'CopyDataFrom'
'CopyFrom'
'CopyTo'
'Count'
'CountAsText'
'CoverArtist'
'CoverAsText'
'CoverKeyFilter'
'Create'
'CreateComicProvider'
'CreateFileHash'
'CreateImageProvider'
'CreateNavigator'
'CurrentPage'
'CurrentPageInfo'
'CustomThumbnailKey'
'CustomValuesStore'
'Day'
'DayAsText'
'Default'
'DefaultAlternateCaptionFormat'
'DefaultCaptionFormat'
'DefaultComicExportFileNameFormat'
'DeleteCustomValue'
'Deserialize'
'DeserializeFull'
'DisplayFileLocation'
'EditMode'
'Editor'
'EnableDynamicUpdate'
'EnableGroupNameCompression'
'EnableProposed'
'EnableProposedAsText'
'Equals'
'ExtraSyncInformation'
'FileCreationTime'
'FileCreationTimeAsText'
'FileDirectory'
'FileFormat'
'FileInfoRetrieved'
'FileIsMissing'
'FileLocation'
'FileModifiedTime'
'FileModifiedTimeAsText'
'FileName'
'FileNameWithExtension'
'FilePath'
'FileRenamed'
'FileSize'
'FileSizeAsText'
'FirstNonCoverPageIndex'
'Format'
'FormatDate'
'FormatFileDate'
'FormatIcons'
'FormatNumber'
'FormatPages'
'FormatRating'
'FormatString'
'FormatTitle'
'FormatVolume'
'FormatYear'
'FrontCoverCount'
'FrontCoverPageIndex'
'Genre'
'GetCustomValue'
'GetCustomValues'
'GetFrontCoverKey'
'GetFrontCoverThumbnailKey'
'GetFullTitle'
'GetHashCode'
'GetIcons'
'GetImageKey'
'GetImprintIconKey'
'GetInfo'
'GetIsoCulture'
'GetLanguageName'
'GetPage'
'GetPageByImageIndex'
'GetPageKey'
'GetPageList'
'GetProperties'
'GetPropertyValue'
'GetPublisherIconKey'
'GetStringPropertyValue'
'GetThumbnailKey'
'GetTranslatedWritableStringProperties'
'GetType'
'GetUntypedPropertyValue'
'GetWritableStringProperties'
'GetYesNoAsText'
'GuidEquality'
'HasBeenOpened'
'HasBeenRead'
'HasBeenReadAsText'
'Hash'
'ISBN'
'Id'
'Imprint'
'InfoText'
'Inker'
'IsDefaultPropertyValue'
'IsDefaultValue'
'IsDynamicSource'
'IsInContainer'
'IsLinked'
'IsLinkedAsText'
'IsSameContent'
'IsSearchable'
'IsValidComicBook'
'IsValidCoverKey'
'LanguageAsText'
'LanguageISO'
'LastOpenedFromListId'
'LastOpenedFromListIdSpecified'
'LastPageRead'
'LastPageReadAsText'
'Letterer'
'LoadFromSidecar'
'Locations'
'MainCharacterOrTeam'
'Manga'
'MangaAsText'
'MapPropertyName'
'MapPropertyNameToAsText'
'MarkAsNotRead'
'MarkAsRead'
'MemberwiseClone'
'Month'
'MonthAsText'
'MovePages'
'NewBooksChecked'
'NewPages'
'NewPagesAsText'
'NoText'
'Notes'
'Number'
'NumberAsText'
'NumberOnly'
'OnBookChanged'
'OnComicProviderCreated'
'OnCreateComicProvider'
'OnFileRenamed'
'OnNewComicPageAdded'
'OnParseFilePath'
'OpenProvider'
'OpenedCount'
'OpenedCountAsText'
'OpenedTime'
'OpenedTimeAsText'
'PageCount'
'Pages'
'PagesAsText'
'PagesAsTextSimple'
'ParseFilePath'
'ParseFilePathEventArgs'
'Penciller'
'PreferredFrontCover'
'ProposedCount'
'ProposedCountAsText'
'ProposedFormat'
'ProposedNakedVolumeAsText'
'ProposedNumber'
'ProposedNumberAsText'
'ProposedSeries'
'ProposedTitle'
'ProposedVolume'
'ProposedVolumeAsText'
'ProposedYear'
'ProposedYearAsText'
'Published'
'PublishedAsText'
'Publisher'
'PublisherIcons'
'Rating'
'RatingAsText'
'ReadPercentage'
'ReadPercentageAsRead'
'ReadPercentageAsText'
'ReferenceEquals'
'RefreshFileProperties'
'RefreshInfoFromFile'
'ReleasedTime'
'ReleasedTimeAsText'
'RemoveFromContainer'
'RenameFile'
'ResetInfoRetrieved'
'ResetPageSequence'
'ResetProperties'
'Review'
'ScanInformation'
'Serialize'
'SerializeFull'
'Series'
'SeriesComplete'
'SeriesCompleteAsText'
'SeriesEquals'
'SeriesGroup'
'SetCustomValue'
'SetFileLocation'
'SetInfo'
'SetPages'
'SetShadowValues'
'SetValue'
'ShadowCount'
'ShadowCountAsText'
'ShadowFormat'
'ShadowNumber'
'ShadowNumberAsText'
'ShadowSeries'
'ShadowTitle'
'ShadowVolume'
'ShadowVolumeAsText'
'ShadowYear'
'ShadowYearAsText'
'SortPages'
'SpecialIcons'
'Status'
'StoryArc'
'Summary'
'TR'
'Tags'
'TargetFilename'
'Teams'
'Title'
'ToArray'
'ToClipboard'
'ToString'
'ToXml'
'TranslateImageIndexToPage'
'TranslatePageToImageIndex'
'TrimExcessPageInfo'
'UpdateBookmark'
'UpdateDynamicPageCount'
'UpdatePageFileSize'
'UpdatePagePosition'
'UpdatePageRotation'
'UpdatePageSize'
'UpdatePageType'
'ValidateData'
'Volume'
'VolumeAsText'
'VolumeOnly'
'Web'
'Week'
'WeekAsText'
'WriteInfoToFile'
'WriteProposedValues'
'Writer'
'Year'
'YearAsText'
'YesRightToLeftText'
'YesText'
The administrator has disabled public write access.

[Script] Same X different Y - Smart List Script 1 year 6 hours ago #46673

  • rmagere
  • rmagere's Avatar
  • Offline
  • Gold Boarder
  • Posts: 223
  • Thank you received: 24
  • Karma: 7
Xelloss wrote:
I add a list of all Attributes a comic has... Most of them you can use for this script (some are pointers and some of them I have no idea what they are XD)

'Manga'
'

Hi Xelloss,

Do you happen to know what value does 'Manga' take? I am trying to use it for the LibraryOrganizer rules to run only on comics that are Manga however neither Yes nor YesAndRightToLeft (the values stored in ComicInfo.xml) work.

Thanks
The administrator has disabled public write access.

[Script] Same X different Y - Smart List Script 1 year 6 hours ago #46674

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
Tried 'True' or 'False'?

I am running a script now, but I will see the value as soon as it is finished :)
The administrator has disabled public write access.

[Script] Same X different Y - Smart List Script 1 year 5 hours ago #46675

  • rmagere
  • rmagere's Avatar
  • Offline
  • Gold Boarder
  • Posts: 223
  • Thank you received: 24
  • Karma: 7
Thanks :) - will try. I assumed it could not be that easy as Manga has 4 values: Yes, Yes Right to Left, No, Blank

I also tried using yes and ltr (which is what appears in the query format of a smartlist that finds manga). That also fail as I get the error message:
'type' object has no attribute 'yes'
'type' object has no attribute 'ltr'
etc


Edit: just tried True and False and get the same error.

Interestingly when I use "language = weird things" it does not complain. I think it might be a bug with the LibraryOrganizer script. Will try to post there as well.
Attachments:
Last Edit: 1 year 5 hours ago by rmagere.
The administrator has disabled public write access.

[Script] Same X different Y - Smart List Script 1 year 5 hours ago #46677

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
I ran a print by console of the fields and this are the values:

'YesAndRightToLeft'
'No'
'Yes'

So in memory is the same as in the XML
Last Edit: 1 year 5 hours ago by Xelloss.
The administrator has disabled public write access.
The following user(s) said Thank You: rmagere

[Script] Same X different Y - Smart List Script 1 year 5 hours ago #46678

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
I tried making a rule in LibraryOrganizer with the Manga field, and something strange happens...

Whatever I put in the rule (the text value), it just doesn't save it, and the next time I try to see the rules the field is empty...

Which version are you using, I think I haven't updated this script for a while...
The administrator has disabled public write access.

[Script] Same X different Y - Smart List Script 1 year 5 hours ago #46679

  • rmagere
  • rmagere's Avatar
  • Offline
  • Gold Boarder
  • Posts: 223
  • Thank you received: 24
  • Karma: 7
Xelloss wrote:
I tried making a rule in LibraryOrganizer with the Manga field, and something strange happens...

Whatever I put in the rule (the text value), it just doesn't save it, and the next time I try to see the rules the field is empty...

That's exactly what happens to me as well (which does not happen with other fields (e.g. Age Rating which I had set erroneously rather than manga once)
I get the "Type" error by making the rule and then not clicking OK but rather clicking on another options within Library Organiser (e.g. file renaming string) - that triggers the type error message.

Similarly (due to the automatic blanking) I get the full error that I attached as an image by setting "Manga is not " (with blank as value) and then running the rule on a set of comics.
Xelloss wrote:
Which version are you using, I think I haven't updated this script for a while...
Right I am using 2.1.8 and there is 2.1.11 available so will update and see if that changes things
The administrator has disabled public write access.

[Script] Same X different Y - Smart List Script 1 year 5 hours ago #46680

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 463
  • Thank you received: 118
  • Karma: 24
Yes, it happens to me too... It must be a bug...
Last Edit: 1 year 5 hours ago by Xelloss.
The administrator has disabled public write access.
The following user(s) said Thank You: rmagere

[Script] Same X different Y - Smart List Script 1 year 4 hours ago #46681

  • rmagere
  • rmagere's Avatar
  • Offline
  • Gold Boarder
  • Posts: 223
  • Thank you received: 24
  • Karma: 7
Posted in the appropriate Script Thread.
Thank you so much for testing it out!
The administrator has disabled public write access.
Time to create page: 0.233 seconds

Who's Online

We have 272 guests and 3 members online