Welcome, Guest
Try to get help from other ComicRack users

TOPIC: Too long filepath problem

Too long filepath problem 5 months 2 weeks ago #47684

  • pueblo
  • pueblo's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
  • Karma: 0
Hello folks!
Do any of you know how to truncate series field in Library Organizer? I'm planning to reorganise my library and want to use series in filename. Right now I have only issue number and CV issue id, but it didn't worked out in a long run. So I was planning to reverse to full or part of series name in filename.
I was thinking about using custom field with truncated series value, but didn't found a way to do it. Any ideas? Maybe in Data Manager?
For example: VeryLongSeriesName to VeryLong...
The administrator has disabled public write access.

Too long filepath problem 5 months 2 weeks ago #47691

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 455
  • Thank you received: 117
  • Karma: 24
I have had this problem for years... I even recommended the Library Organizer script creator to put a truncate option... and he said it was a good idea

Now that you mention it, I have thought something like what you are saying (or what i understand you are saying). To create truncated fields and then use that in library organizer... the problem was that it is not always the name that it is too long... sometimes is the series, sometime the title... etc... (I used a lot of fields in my urls)

However you gave me and idea for a new script that analyse all that...
Last Edit: 5 months 2 weeks ago by Xelloss.
The administrator has disabled public write access.

Too long filepath problem 5 months 2 weeks ago #47692

  • pueblo
  • pueblo's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
  • Karma: 0
Xelloss wrote:
However you gave me and idea for a new script that analyse all that...
You're Welcome :laugh:
The administrator has disabled public write access.

Too long filepath problem 5 months 2 weeks ago #47693

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
OK. So it seems you may want to only use the first two words of a series if the series name is too long.

A simpler version to start with would be to place only the first 10 letters into a custom field but I seem to be hitting a reoccurring bug with Data manager which I will have to report.

Problem is DataManager is going through a major rewrite so it may take a while to get fixed before I can write a working RegexReplace script.

P.S. A Set number of words would also be possible but without the script working properly I can't trial and error such a rule.

Just in case you have an older working Data Manager script:

For ten letters you check with Regex that the series name was eleven or more letters. Simplest Regex would be:
Series Regex ^...........

and then move it into a custom field:

TruncatedSeries Set Value {Series}

Then regex replace it with only the first 10 letters:

TruncatedSeries RegexReplace ^(..........)||$1

Then of course you would use TruncatedSeries instead of Series in Library Organiser.

If it worked this would be the rule:

File Attachment:

File Name: TruncateSeries.zip
File Size:0 KB
Last Edit: 5 months 2 weeks ago by jkthemac.
The administrator has disabled public write access.
The following user(s) said Thank You: pueblo

Too long filepath problem 5 months 1 week ago #47713

  • pueblo
  • pueblo's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 15
  • Thank you received: 2
  • Karma: 0
Does RegexReplace work in earlier version of Data Manager? I'm actually using both 1.x and 2.x simultaneously for different purposes so I might use it.
I will keep an eye on DM updates anyway.
Thank you for your help! :)
The administrator has disabled public write access.

Too long filepath problem 5 months 1 week ago #47714

  • jkthemac
  • jkthemac's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 766
  • Thank you received: 253
  • Karma: 55
Possibly, but because I wasn't able to test it I failed to anchor the replace properly it should read:

^(..........).*$||$1
The administrator has disabled public write access.

Too long filepath problem 5 months 1 week ago #47717

  • Xelloss
  • Xelloss's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 455
  • Thank you received: 117
  • Karma: 24
I have been looking at cases in which I have long filename problems... and at least in my case the problem is usually long title names (specially combined with long series name)

In 99% of the cases, it is because of multiple story titles, usually separated if you use CV scraper with a ";"

So my idea is the following:

A script that calculate the size of the series + the size of the title.

If it is smaller than x (150 for example, to give space to more fields in the url) then the title is copy exactly the same to a custom value named "short title"

If it is larger than x, then it cut the last part of the title till the last ";" (I cut the last "story title" from the title) and compare again the size

I repeat this step till the size is smaller than x or I run out of ";" in the title. In case of the first I copy the "truncated" title to "shor title" in case of the second, I try another method... (I have to think it, it could be let the "short title" empty)

All in all this script would solve most of the long url problems... (at least in my case)

Of course you then use "short title" in the Library Organizer

Edit:

If you have problems with long filenames and it is not because of the title, please send me examples of them (the complete long name) and I will try to find a solution for your problem specifically
Last Edit: 5 months 1 week ago by Xelloss.
The administrator has disabled public write access.

Too long filepath problem 5 months 4 days ago #47851

  • Drybonz
  • Drybonz's Avatar
  • Offline
  • Gold Boarder
  • Posts: 296
  • Thank you received: 1
  • Karma: 9
Not sure if this is helpful, but you can prevent long file name problems by taking out characters of folders within folders... so if you have your library buried in multiple folders, it adds to the total filepath if the folders have a lot of characters... so placing the library closer to the root can help you solve some of those problems.
The administrator has disabled public write access.
Time to create page: 0.189 seconds

Who's Online

We have 254 guests and 5 members online