maforget / ComicRackCE

A Community Edition for the legendary Comic Book Manager ComicRack. ComicRack is back from the dead.
GNU General Public License v2.0
344 stars 34 forks source link

Updating Publisher.zip/Format.zip #62

Open killo3967 opened 8 months ago

killo3967 commented 8 months ago

Describe the bug When updating the program in windows the installation overwrite publisher.zip

Could be posible to not ovewrite the files on this path "C:\Program Files\ComicRack Community Edition\Resources\Icons" if the files are newer?

I added a more complete publisher.zip if you want to update it.

Publishers.zip

maforget commented 8 months ago

There is an option in the installer to not install "Additional images, icons and backgrounds". This should do what you want.

I can't access my computer right now, but I will gladly update the Publisher file the moment I can.

maforget commented 8 months ago

From #63 by @killo3967

Publisher logo images that have names with accents, accents, and umlauts are not displayed.

In my case i updated the publisher.zip with the logos of:

Éditions Glénat Les Humanoïdes Associés Denoël Graphic

But not logos show in Tiles-view. Tested also in old comicrack and works fine.

maforget commented 8 months ago

Ok regarding the accented characters not appearing in the new version. This is a change from the SharpZipLib in the new versions. The way character encoding as changed from the default.

Now you can either set character encoding manually when reading:

https://github.com/maforget/ComicRackCE/blob/cb76e9bf6412a10056c64b25fd73fe83063116b7/cYo.Common/Compression/ZipFileFolder.cs#L20-L23

could be changed to:

public ZipFileFolder(string zipFile)
{
    //437 is the default Zip char Encoding. 850 is the default western windows
    this.zipFile = new ZipFile(zipFile, StringCodec.FromCodePage(437));
}

Or when creating the Zip file force the UTF-8 flag for the entry and that way it will be detected automatically. This can be achieve (at least with 7-Zip), by either:

  1. Set the windows settings to "Beta: Use Unicode UTF-8 for worldwide language support"
  2. When creating the zip add cu in the Parameters textbox. It will force UTF8 on entries that uses it.

You can confirm the file is correctly created by opening it in 7-Zip and clicking on an entry that had accents and pressing info. Under characteristics you will see NTFS : UTF8 instead of NTFS up.

Try this file: Publishers.zip P.S. I've added Glénat to the string, because most of my books are all scrapped under Glénat and not Éditions Glénat.


Also regarding your initial remark about not overwriting the Publisher file, in addition to the option I mentioned. You can actually have multiples files. The search pattern is Publishers*.zip, so you could add anything and have _Publisher_French.zip_ for example.

You can also add them into your data folder. It supports, alternate configuration (-ac) and portable mode also (-local). Some folder the program will look into:

"{InstallDir}\Resources\Icons"
"%ProgramData%\cYo\ComicRack Community Edition\Resources\Icons"
"{DataDir}\Resources\Icons"
maforget commented 7 months ago

I've updated the Publishers.zip based on yours in fc2947db477d5afde88966710d2bd13e5a70371b, but There are still a lot that might need updating.

I will let this issue open as a place to update the Publishers.zip

killo3967 commented 7 months ago

I follow your instruction to add "cu" parameter when compressing the folder, but dont work. After compress I check that the file "Glenat#Glénat#Glenat Italia#Glénat Spain#Éditions Glénat.png" have the NTFS:UTF8 characteristic and it does. After this, I copy the file and rename, the copy, to Éditions Glénat.png and now it works ahd comicRack diskplay the logo. Could be the "#"?

I don't know why your file works and mine no.

I checked the headers of both pulishers.zp files and they are complete diferent. What software do you use to compress the folder? I use 7-zip 23.01(x64) in windows 11.

maforget commented 7 months ago

I use the same software. 1 thing I've discovered is that you can't rename a file after it is compressed with cu it loses UTF8.

And I can confirm it is the é É, they are read as ,.

killo3967 commented 7 months ago

I'm sorry if I didn't make myself clear, but don't rename it afterwards, rename it before recompressing it. Let's see if this time I explain better. I have taken the file "Glenat#Glénat#Glenat Italia#Glénat Spain#Éditions Glénat.png" and I have duplicated and renamed it to "Éditions Glénat.png", then I have compressed it with the option "cu" and it has shown me the logo in those comics that had the Publisher to "Éditions Glénat", but those that had it for example to "Glenat" or any of its variants has not shown it.

What surprises me is that with the file you sent me it does show the logos in all the variations, that's why I say that either I'm not doing something or the programs or procedures we are using are different.

maforget commented 7 months ago

In the file I sent, I've added Glénat to the line. Because you had Glenat (without the é), but not Glénat (with the é), which is what the scrapper returns for most Glénat comics. Maybe that is why mine is working on more comics.

maforget commented 7 months ago

Was on mobile, didn't read your message completly. So you have "Glenat#Glénat#Glenat Italia#Glénat Spain#Éditions Glénat.png" along side "Éditions Glénat.png"? It shouldn't change anything, it would take only 1 Éditions Glénat, the first one it encounters.

Here are the settings I've used: image

A note from what I saw in the 7-zip discussions pages on sourceforge, the setting I mentioned "Beta: Use Unicode UTF-8 for worldwide language support" can change the behavior of 7-zip. Normally it sets it to UTF8 only if it is needed on an entry. Maybe windows code page can affect it also, like western vs eastern.

I could change the program so it uses code page 537, which is the default for zip files and it should be universal for everyone. I just want to test if files with say Japanese Characters would work also with 537.

maforget commented 7 months ago

After some test with Japanese characters, i've updated the default Code Page to OEM (437). This should permit wide compatibility with pretty much all Zip software, without any special settings (aka the cu parameter).

WIth either 7-zip or WinRAR when using Japanese character it will force it to be UTF8, as there is no choice. Windows will just say that it can't create the zip. Since the Japanese entry is UTF8 it is still read correctly alongside entries like Glénat, which are also read correctly even if they aren't UTF8.

With this change e1a7a1b7e3549436482b54c047f7e2162b39513b all accented character are read correctly regardless of the software used, at least WinRAR, 7-Zip & Windows works correctly.

killo3967 commented 7 months ago

Tested and now CR could display the logos, anyway i'll use cn option in future. Thanks very much.

maforget commented 7 months ago

I've added some myself. I didn't resize them, because they would lose too much detail and the program doesn't seem to care.

Publishers.zip

ucapato commented 7 months ago

Can use this thread to bring other Publisher Icons to be added in future updates for Publishers.zip? As I had some self made Publisher Icons to bring in.

I also had some icons for Book Formats as well (e.g: Omnibus, Series instead of the standars Limited Series...)

maforget commented 7 months ago

Yes that's the point to share our files so we can update it.

ucapato commented 7 months ago

Hi,

I created some icons for Formats:

Series.png (icon: SER): For Series (So, the original file "Limite Series#Series.png") was renamed to #Limited Series.png") Omnibus.png (icon: OMN): For Omnibus Fan Made.png (icon: FME): For fans that want to make their self art work Edit.png (icon: ED)

Formats.zip

ucapato commented 7 months ago

I've added some myself. I didn't resize them, because they would lose too much detail and the program doesn't seem to care.

Publishers.zip

For this Publishers.zip file, I added a few more from the collection I have:

Globo.png Marvel Now!.png Pipoca & Nanquim.png Rio Gráfica e Editora.png Webtoon#Line Webtoon.png

[Uploading Publishers.zip…]()

maforget commented 7 months ago

Uploading Publishers.zip…

Your Publishers.zip didn't upload.

ucapato commented 7 months ago

Uploading Publishers.zip…

Your Publishers.zip didn't upload.

Sorry,

Here it goes

For this Publishers.zip file, I added a few more from the collection I have:

Globo.png Marvel Now!.png Pipoca & Nanquim.png Rio Gráfica e Editora.png Webtoon#Line Webtoon.png Publishers.zip

jrft1379 commented 5 months ago

Question about multiple publishers: There are plenty of books that have more than one publisher (Amalgam Comics, for example, are from DC and Marvel). How do you get CR to recognize that in the icons? I've tried a couple of methods, but they don't seem to work.

For reference, I have the individual publishers separated by a comma, that way they also show under the individual publisher when I narrow my library down.

I tried to have the icon names match the field name (i.e. DC, Marvel), but I realized that didn't work because CR isn't recognizing them as one entity that gets a special icon.

Also, I've noticed that the "/" character has no replacement value when it comes to the icons. For example, AiT/Planet Lar won't show up. I've tried substituting the "/" with "-" and just leaving a space instead. Neither worked for displaying the icon.

Any thoughts or ideas for either of these?

maforget commented 5 months ago

Question about multiple publishers: There are plenty of books that have more than one publisher (Amalgam Comics, for example, are from DC and Marvel). How do you get CR to recognize that in the icons? I've tried a couple of methods, but they don't seem to work.

For reference, I have the individual publishers separated by a comma, that way they also show under the individual publisher when I narrow my library down.

The Publisher field isn't a multi value field like Tags for example. So adding a comma will not give you 2 value just a value that has a comma in it. But when parsing the Publisher filenames it does split it by comma and #. https://github.com/maforget/ComicRackCE/blob/f8cf2f46f10d2d781b2030cd9c9a5c365f77574c/ComicRack/Program.cs#L946-L969

The program returns an array of icons when checking them, so technically it might be possible. I am looking at the tags section, it checks for text in the Tags section in the Special.zip file. https://github.com/maforget/ComicRackCE/blob/f8cf2f46f10d2d781b2030cd9c9a5c365f77574c/ComicRack.Engine/ComicBook.cs#L1861-L1943 https://github.com/maforget/ComicRackCE/blob/f8cf2f46f10d2d781b2030cd9c9a5c365f77574c/ComicRack.Engine/ComicBook.cs#L1841-L1849

Solution may be to have 1 be the Imprint the other the Publisher, have a special icon with the 2 and use the map.ini file for special characters. So you could do an icon that has DC & Marvel and call it via the map.ini if it has special char so DC_Comics_Marvel.png = DC Comics, Marvel as an example. Check the Formats.zip for an existent example. Or use the Tags section with a special icon.

I don't know if multiple publisher are very prominent that it would require changing how they work internally, but implementing a way to spit out more than 1 icon, seems to be possible without any UI work.

ucapato commented 5 months ago

Hi,

During my Collection Catalog process, I added some more publishers to Publisher.zip. All the previous icons were kept. In addition we have:

Amigo Comics#Amigo.png Andrews McMeel#Andrews McMeel Publishing.png (update) Avatar Press.png (update) Black Mask#Black Mask Studios.png Bloch#Bloch Infanto Juvenil.png D-Arte#Editora D-Arte.png Dead Dog.png Delcourt.png (update) Devir Livraria.png DMG Entertainment#DMG#Valiant Comics#DMG Valiant Entertainment.png Dom Quixote Publicações.png Ediouro.png Ego#Ego Editora.png Farrar, Straus and Giroux#Farrar Straus Giroux#Farrar, Straus, Giroux.png First Comics#First.png (update) Fox Atomic Comics.png Graphic India.png Great Big Comics.png Legendary Comics.png Mudnag.png Mythopoeia.png Mythos Editora.png Now Comics.png Planeta Cómic.png Rizzoli Lizard.png Simon and Schuster#Simon & Schuster.png Skript#Skript Editora.png Super Genius Comics.png Super Nova Produções#Super Nova.png Ten Speed Press.png Ubisoft#Ubisoft Entertainment.png Vecchi editora.png Warren#A Warren Magazine.png

Publishers.zip

denis-anikin commented 5 months ago

Any reason to update "Zenescope Entertainment"? In the original archive of old ComicRack there was a transparent background, now white

denis-anikin commented 5 months ago

Same with "Drawn and Quarterly#Drawn & Quarterly" if I'm not mistaken. Transparency is gone.

ucapato commented 5 months ago

Hi @denis-anikin

Probably resolution was a bit better at those. But I'll remove the white background and update the zip content.

ucapato commented 5 months ago

Here they come,

All the latest additions as previous mentioned, plus the removal background from "Drawn and Quarterly#Drawn & Quarterly" and "Zenescope Entertainment".

Publishers.zip

maforget commented 5 months ago

I've updated the way the build is done in regard to these icons. The icons are not stored as zip files anymore, they are now stored as individual icons instead. So it is way easier to see what as been updated, added or removed. So if you check the commit 0340ab422341a4cc8f1121769d7d4050c63c2d50, you can even see the icons directly on github now. For example the icon for Avatar Press shows the icon that was removed and the one that was added.

It will make cooperating easier, anyone that wants to contribute can just change the icons in the Resources\Icons folder and create a commit. Then you can do a PR, so your contribution will be tracked on github.

The project files will take any folder that is in Resources\Icons and add them to the project without any modification. It also support any number of directory that are present in that folder, for future proofing in case we want to add new zips. A powershell script will be called during the build and zip them up.

ucapato commented 5 months ago

Great @maforget,

Thanks a lot for this way of working to update the Resources\Icon folder. So, in other words, do we need to use Git knowledge to be able to update in case bringing up a new icon? I can copy the ComiRackCE Repo to my machine, perform the updates I want, and then add/commit/push to the Main Repository here in Git, isn't that right? Sorry for the silly question, but I am trying to learn how to use Github productively.

ucapato commented 5 months ago

I ended up making a fork of ComicRackCE, so I could add, commit and pushed the proposed Format icons to my own Fork. But I am note sure if this is what was exactly proposed here or if there is a better practice.

maforget commented 5 months ago

@ucapato Yes that is the proper way to do it. You can use GitHub directly for basic things like uploading new files, renaming. Using a git client for local changes is required for more features. If you don't have or require the whole Visual Studio program just to edit icons, the Github desktop client is pretty good at using the git features with a GUI.

[!WARNING] If you do any contribution, I suggest that you make sure the checkbox, keep your email private is enabled in Github settings or your email address will be attached to each and every commit you do. With that setting enabled a github email address proxy will be used instead.

ucapato commented 5 months ago

Hi @maforget ,

Appreciate your assistance and patience in explaining how Git and Github work. I am still sometimes lost with the technical words and behavior, but to ride a bike we need to fall sometimes, right? Here we go:

  1. I started with the left foot. Had done a fork, clone it into my Client (I am using IntelliJ instead of Visual Studio), and updated the Format folder with my suggested Icons in the Master Branch. Only after that, I have read your advice here.

  2. Still, no problem (I guess), I've found some guidelines and I was able to restore my branch by adding the Upstream Remote from your Master, resetting it, and pushing your Master to my Fork again. So now I got my Master's exactly as yours.

  3. Now I have created a branch (git checkout -b NewUpdatedIcons in IntelliJ Terminal window) for my Master Branch and desired changes I'll apply to this NewUpdatedIcons branch only.

  4. When you mention " In the GitHub client if you set the fork behavior in the repository settings to contribute to parent, when you create a fork it will be based on my master". How do I achieve that? Or, should I simply click on "Contribute" when adding changes to my NewUpdatedIcons branch as I see in the snapshot below:

image
  1. But if my assumption on Item 4 is correct. I first need to make my changes, add, commit, and push in my client branch, and this will be "sent" to my branch in Github, only then I can do PR. By PR I understand I am asking to add changes to your Repo. Did I get this right?
maforget commented 5 months ago

@ucapato When I talk about the Github Client I was referring to the Desktop client you can install on your computer. You can do the same thing with your IDE, although it may be more straight forward to use the client. https://github.com/apps/desktop

In the GitHub client if you set the fork behavior in the repository settings to contribute to parent, when you create a fork it will be based on my master.

The setting I was referring too was this one. Screenshot 2024-07-02 202548 Screenshot 2024-07-02 202757

It just determines how a new branch will be created either from your master or from mine. If from yours it would be necessary to do what you did in point 2. With the option to contribute, like you can see in the help message on the screenshots, it just creates a branch based on my master. So if I push something new and your master lags behind the new branches will still be based on the newest code. On the website when creating a branch you can choose from which repo/branch to create it. In the Github desktop client a upstream/master is automatically added or your need to do it manually like you did.

Your assumption in point 5 are correct except the contribute option like I talked about earlier. It doesn't do anything until you push something to your repo. At that point it will suggest to merge your NewUpdatedIcons to my master. But you need to push code before that becomes an option. But yes a PR is like asking to add changes to my repo.

Git is very confusing, I am just starting to be somewhat knowledgeable enough to use it effectively. It also doesn't help that all the help all refers to the command line. I am conformable using the command line, but doing something via 2 click in a GUI is easier than having me trying to use a command I will forget anyway. Suggestion I can give you is that you can create as much branches that you want locally and test things out. You can create a backup branch based on another in case you mess up. As long as you don't push code, it stays local.

For example on your error in point 1, where you committed in master. If you didn't push to Github, you could just have done a Reset (mixed keeps your changed file but removes your commit). Stash the changes (keep for later) so that you can change branches and then push those changes to that new branch. Or create a new branch and cherry-picking the changes from your master and resetting it (with hard, so it deleted changes).

ucapato commented 5 months ago

Ok,

I think I got it now (I hope). I added the new format icons in addition to two new ones (Main Series and Year Zero), set my branch as a contributor to yours, committed, pushed, and did the PR.

image

Definitely from the Desktop Client, the whole Git process looks much easier, but I'll try my chances (sometimes) in the regular command prompt to see how to do this PR.

Thanks a lot for all the advice and way forward here.

chowbok commented 4 months ago

The Andrews-McMeel icon change is a downgrade, IMO. It's an icon -- the text is unnecessary. Also, the transparency has been removed.

ucapato commented 3 months ago

The Andrews-McMeel icon change is a downgrade, IMO. It's an icon -- the text is unnecessary. Also, the transparency has been removed.

Hi @chowbok ,

The latest merge brings the suggested change:

image

maforget commented 3 months ago

I've moved the files that where in Resources to Output/Resources. So the Publisher directory is now Output\Resources\Icons\Publishers for the source. The final directory will still be the same.

The Resources directory now contains the program icons that were previously embedded instead.

maforget commented 3 months ago

Just a FYI when adding publisher icons, adding an icon with no date along with those with dates, like in this commit https://github.com/maforget/ComicRackCE/commit/b62cd2c093a8bdf01e90f7ca10716e19e60c7186. The icon without a date should be the latest one.

The reason is that when adding comics where the date is proposed (pale grey), it will consider the date empty and show the old icon. At least for those that have these dates in proposed value, we should at least show the latest one and not the old one.

ucapato commented 3 months ago

Just a FYI when adding publisher icons, adding an icon with no date along with those with dates, like in this commit b62cd2c. The icon without a date should be the latest one.

The reason is that when adding comics where the date is proposed (pale grey), it will consider the date empty and show the old icon. At least for those that have these dates in proposed value, we should at least show the latest one and not the old one.

ok,

So I can "invert" the naming convention from the proposed Publisher Icons I have sent, like Dark Horse's Example, today is like:

Dark Horse#Dark Horse Comics.png ==> Oldest Icon Dark Horse(1990)#Dark Horse Comics(1990).png Dark Horse(1991)#Dark Horse Comics(1991).png Dark Horse(1992-2003)#Dark Horse Comics(1992-2003).png Dark Horse(2004-2050)#Dark Horse Comics(2004-2050).png ==> Newest Icon

It should be like: Dark Horse(1986-1989)#Dark Horse Comics(1986-1989).png ==> Oldest Icon Dark Horse(1990)#Dark Horse Comics(1990).png Dark Horse(1991)#Dark Horse Comics(1991).png Dark Horse(1992-2003)#Dark Horse Comics(1992-2003).png Dark Horse#Dark Horse Comics.png ==> Newest Icon

Indeed it makes much more sense and makes us not try to "guess" what is the ending date for the latest/newest Publisher Icon. I can fix this naming convention for all those Publishers with a date. I'll do that on my next Commit.

Note: For the future, it would be nice if we could determine the Icons date by Year and Month instead, but I am not sure how complex it is to implement in the code. Publisher names could be like: "Publisher(YYYYMM-YYYYMM).png". But it is just a thought.

killo3967 commented 2 months ago

Please add Caliber Comics logo when you could.

https://calibercomics.com/

CaliberLogo

maforget commented 2 months ago

Please add Caliber Comics logo when you could.

Done

killo3967 commented 2 months ago

Please add "Best Jackett Press" logo when you could

https://imgur.com/ILJsN7U

firefox_qbqqGBYSqu

maforget commented 2 months ago

Please add "Best Jackett Press" logo when you could

done, the winget update should be automated now. Just waiting for approval.

killo3967 commented 1 month ago

Please add publisher "Standaard Uitgeverij" when you could Standaard Uitgeverij

maforget commented 1 month ago

Please add publisher "Standaard Uitgeverij" when you could

Done in b6392f32666f16c53a36f6649c2d6fa0ef25c351

killo3967 commented 3 weeks ago

Please add 'Vault' to 'Vault Comics' logo name when you could.