Welcome, Guest
Python Scripts for ComicRack

TOPIC: Using Data Manager to backup multiple fields into the XML file within the CBZ

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45127

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
This is an experimental post, so I am not posting it in tutorials unless it becomes more solid. Experiment at your own risk and backup data first.

It is theoretically possible to achieve the holy grail of backing up every field not stored in the XML file into that file by storing it in the notes field using Data Manager.
I am currently experimenting with doing this with the Tags field, but the idea would be to use it for multiple fields.

For a simple data format I am placing the data between colons with the field name marked as so:
Tags:'ANAD, To Read, Top Ten':Tags

My initial Data Manager rules do two things. They repopulate empty tags and then backup those tags. If tags already exist they also back these up.
The rules rely on the Review field being empty. We need an empty field at present because of limitations in Data Manager.

They don't rely on the notes field being empty but they will append the data to the end of that field. I would like to use new lines to store the data, but again limitations apply.


File Attachment:

File Name: TagBackup.zip
File Size:1 KB


This is a proof of concept, but other fields could also be appended and backed up in the same way. I would love to do this in a way that preserved both Notes and Review but I am still looking for a work around for a few limitations in Data Manager.

NOTE: the data will only be backed up into the XML file if you automatically or manually update any changed files.
Last Edit: 1 year 8 months ago by jkthemac.
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45130

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
I have now created a work around for the review field being used, by backing that up temporarily into the notes field also. Again please be cautious and backup any data before experimenting.


File Attachment:

File Name: Tagbackup3.zip
File Size:1 KB

(updated with relevent comments)

Note currently the review field isn't backed up such that it can be saved into the XML because I deliberately delete the data but it would be possible by removing the last instruction rule in the Repopulate Review rule.
Last Edit: 1 year 8 months ago by jkthemac.
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45133

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
So now that this proof of concept seems to be working OK which fields would people want to see backed up into the XML that currently are not?

Right now I cant see an easy way of doing this for custom fields, and date fields would be too tricky at this stage, but theoretically anything else could be backed up like this. You will just end up with a long Notes field with lots of nested field data appended to it.
Last Edit: 1 year 8 months ago by jkthemac.
The administrator has disabled public write access.
The following user(s) said Thank You: Xelloss

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45159

  • T3KN0Gh057
  • T3KN0Gh057's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 407
  • Thank you received: 114
  • Karma: 27
Data Manager 2.01 will help you with custom fields the way you want.

Also a brief description of how to do what you propose here

I still think its RETARDED that we have to resort to such ugly tactics, just because the creater of an AWESOME program refuses to give the metadata portion of his app full storage capabilities. I mean if there's info someone doesn't want its easier to delete it than it is to re-obtain info you do want. Also its retarded to lose all your info because of a Reinstall, A data loss, or a program error (which has happened to me several times, and while cYo may think the database backup is clever i think its redundant when one could just store it in the comic and read it from there whenever needed. The difference is backup serveral times after adding or editing vs Edit the comics once and save.

The whole argument he stands on is that someone may put crazy info in a comic file. I stand on the fact that you can always edit it if you recieve a file with crazy info, but if you lose data for files that contain the info you painstakingly edited, its not coming back if its not stored in the file.
Last Edit: 1 year 8 months ago by T3KN0Gh057. Reason: To make a point
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45162

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
Well, I have not had an issue since farming out my database to my SQL Nas Box but I know people do want to do this and it occured to me it wouldn't be that hard with a bit of regex and Data Manager. Thanks for letting me know about v2 I will give it a try soon.

This method could also be a way of sharing metadata. A rule to pack detailed custom data about say a big crossover, into the xml files, and then share just those files and the rule to unpack them back into the database.
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45164

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
I immediatly notice an odd behaviour that I assume is a bug. If I highlight an action with somthing complex like a regex replace and then highlight some but stangely not all simple actions like setvalue or add, the value box stays the same as the previous action.

So if I highlight the top action here:




Then the next here:




The value highlighted in red should be {review}

I just noticed i posted this to the wrong thread!
Last Edit: 1 year 8 months ago by jkthemac.
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 1 year 8 months ago #45170

  • T3KN0Gh057
  • T3KN0Gh057's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 407
  • Thank you received: 114
  • Karma: 27
jkthemac wrote:
I immediatly notice an odd behaviour that I assume is a bug. If I highlight an action with somthing complex like a regex replace and then highlight some but stangely not all simple actions like setvalue or add, the value box stays the same as the previous action.

So if I highlight the top action here:




Then the next here:




The value highlighted in red should be {review}

I just noticed i posted this to the wrong thread!

Yes this is an unintentional bug. Will check and fix.
Last Edit: 1 year 8 months ago by T3KN0Gh057.
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 6 months 4 weeks ago #47334

  • Surfal666
  • Surfal666's Avatar
  • Offline
  • Senior Boarder
  • Posts: 64
  • Thank you received: 4
  • Karma: 2
So as I've been retagging my collection, I've been thinking about this problem, and this particular solution.

Mildly crazy idea:
How about serializing the book object to a string and writing that into the notes field? This might not be appropriate to implement as part of data manager but certainly could be handled by a plugin of some type. Creation of the UI for reconciliation of the data on restore might be the hardest part.

Totally insane idea:
Given that CR is written in IronPython on .NET, it's possible to monkey-patch the function that reads and writes the XML. We could inject a new DLL with the appropriate function signature... Disclaimer: I've done this for C++ and C# apps, not IP but the principles should apply. Only really worth the effort if we really think that the Almighty Creator isn't coming back...

(Sigh. and maybe I'm just out of my mind here.)
The administrator has disabled public write access.

Using Data Manager to backup multiple fields into the XML file within the CBZ 6 months 4 weeks ago #47335

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
I like your thinking but its technically illegal. (The totally insane option obviously).

When the bugs finally get ironed out of Data manager I will come back to this project, because its theoretically pretty easy to do.
Last Edit: 6 months 4 weeks ago by jkthemac.
The administrator has disabled public write access.
Time to create page: 0.244 seconds

Who's Online

We have 271 guests and 3 members online