Welcome, Guest
Share your ideas

TOPIC: Update file link in comics manually

Update file link in comics manually 10 months 3 weeks ago #48924

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 599
  • Thank you received: 152
  • Karma: 31
I know CR is probably dead, but just in case I add this topic before I forget XD

CR manage comics separetely in the files and in its database... only linking them by the field "file name"

If you, for example move a file in your HDD, then in CR you lose the link and the comic is then left as a "fileless comic"

Then if you want to readd the file, or you move the file and rename it EXACTLY as the link in the database, or you delete the comic and readd them... losing all not infile saved data...

What I am asking for is the ability to, with a button for example inside the comic properties, "update" the link... open a windows files window and choose which file to link the database comic... so for example, if you renamed the file by mistake, you just update the path there and everything works fine!

Edit: Thinking about it, I can make an script that do this... mmmh... XD
Last Edit: 10 months 3 weeks ago by Xelloss.
The administrator has disabled public write access.

Update file link in comics manually 9 months 4 weeks ago #49206

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 599
  • Thank you received: 152
  • Karma: 31
I just made a little script for this:

File Attachment:

File Name: ChangeFileLink.zip
File Size:1 KB


(as usual copy the py file to the script folder)

For using just do a right click in the comic you want to update the file link (it can be a comic with file link corrupted) and go to Automation, Change File Link. A Windows file dialog will open to select the file you want the book to be linked to, with all the data in ComicRack intact....

This is mostly to fix comics in the database with broken links, but you can also use it to update the comic version by linking the comic to a new file... (remember the data in CR will not change after changing the file). The other way to do dat before, that I knew of at least, was to copy the file exactly to the path and name of the path in the comic entry... which was a headache for doing with multiple files.

I really think this should be an option in ComicRack... Perhaps it is and I don't know how to do it, but at least I can do it now with this XD

ps: You can select multiple comics, and select the files one by one :P

edit: If you don't understand what this does, just think as comics in ComicRack as shortcuts in windows, and not files. This script let you edit the path and name of the file it goes to, letting you keep all the other info stored in the shortcut.

It is probably this script can evolve later to one that fix file links based on automatic rules (for example searching for comics with the same name and number in the same folder), but for now you can at least do it manually and being sure it is correctly fix (and in different folders)
Last Edit: 9 months 4 weeks ago by Xelloss.
The administrator has disabled public write access.
The following user(s) said Thank You: rmagere, secondsabre

Update file link in comics manually 6 months 2 weeks ago #49593

Necro'ing this thread, but it's not *that* old yet.

First off, thanks so much, Xelloss. This script helped to tackle a problem that I had been dreading dealing with, updating my CR database with the new files I've gotten over a period. I figured updating the file-path would be pretty much perfect, in much the same way that Calibre does it, since the DB entry is all that really needs to be updated.

However, it's caused a new problem to pop up, and I'm trying to figure out a way around it. Basically, changing the filepath works fine when it comes to opening or finding the files directly, but it causes duplication in the database. When CR find one of the 'new' files in my library/watch folders, it assigns it a new "book id" in the database. I'm not sure if that book id is generated by random hash, filename, filesize, or some combination, but I now have two entries for the book:

1) the "old" entry has metadata, is included in various lists, and has the wrong filepath;
2) the "new" entry has no meta or list info, but has the correct filepath.

Changing the filepath ala your script (from the old file to new file) updates the filepath in the database for the "old" entry, but doesn't update the file information (filesize, added, modified), or remove the "new" entry from the database, so we have two entries for the same book with the same filename, but different book id and file properties.

I'm not really sure what my options are at this point. Part of me is thinking about expanding the script to do some kind of check for duplicate file-paths, or some kind of basic merge/replace. Even better would be if ComicRack had some sort of built-in option to consolidate entries, checking for matching filepaths and the like, or even forcing it to update the file info attributes. I'm poking around in the API to see what I could do with my limited knowledge, but any help or input would be fantastic. Thanks in advance, all
The administrator has disabled public write access.

Update file link in comics manually 6 months 1 week ago #49604

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 599
  • Thank you received: 152
  • Karma: 31
You can easily do that with my "Same X Different Y" script, just look for comics with the same FilePath with this script in a smart script...

You can even then sort or filter by other fields, as add date, if they have fields empty, etc...

I can make a script that look for same comics in the library and "fuse them" automatically, but I don't think it would be needed really...

Here it is the script:

comicrack.cyolito.com/forum/13-scripts/3...ipt-ver-0-7-18-10-17

Install it, and use it in User Scripts in any smartlist... Just put in the first field "FilePath" and leave the second one empty. It will show ou alll comics with duplicated file path...
Last Edit: 6 months 1 week ago by Xelloss.
The administrator has disabled public write access.
The following user(s) said Thank You: secondsabre

Update file link in comics manually 6 months 1 week ago #49605

Yea, I've been using the "Same X Different Y" script (great work, btw) for a while already to help to cut down on the duplicates I have, usually by matching filenames. It's not bad for a manual system, but I'd be lying if I said I didn't dream of an add-on that would let me merge/replace books easily.

I've been poking around through other scripts to get ideas, but ideally, I'd love to be able to select a book (or two), choose which info/file I want to keep, and then replace all matching entries in the DB with the new file. It would make updating my files way easier, instead of having to decide which BookID gets kept, and manually re-adding files to various lists because they're already spread across multiple files. It should be as easy as combing the DB for matching BookID's and replacing them with the new one, but the intricacies are still a little beyond me. I'm still learning.

Thanks for your help with everything else though, multiple posts you've made throughout the forums have been excellent in helping me get my database back under control. I guess this is what happens when you update everything and let the DB go to seed for a while, haha. =P
The administrator has disabled public write access.

Update file link in comics manually 6 months 2 days ago #49613

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 599
  • Thank you received: 152
  • Karma: 31
That's the problem with using static lists... you are tied to ComicIds instead of a particular field with smart lists... I never use static lists because of that.

Never worked with scripts that "touch" lists though... I cannot help you there U_U
The administrator has disabled public write access.
Time to create page: 0.168 seconds

Who's Online

We have 468 guests and 2 members online