This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 22 - Pages: 2 [ Previous | 1 2 ] - Last Post: 15 Jul 23, 00:43 Last Post By: RobM Threads: [ Previous | Next ]
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 12 Jul 23, 23:41   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Maybe it is a memory problem, processing a lot of files and texts. Once the tool has been run on a folder it will not make any changes to the jAlbum objects unless the existing comment is different to that of the text file.

I'll have a read through the code and see if I can either improve it or find a flaw. It might take a few days though. If you can get it to fail, and ideally copy the system console log and post it, I will have something to work with.

Until then...
MarkusD

Posts: 642
Registered: 13-Apr-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 13 Jul 23, 07:25   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I created a 7z-file with some "source" comments.
https://www.markus-drueck.de/JA/Mobility.7z

Keep in mind that I'm just replacing the comments of folders not files. Maybe this makes a difference. And the source files are rather big. The biggest one is 1.086.233 Bytes.
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 13 Jul 23, 23:44   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
I can only get the tool to fail if an album object's file does not exist, like a broken link to the file.
I have updated the tool to ensure the file exists before trying to process the object's associated texts file.

Movie of tool in progress on my Mac at https://robm.jalbum.net/TestingText2CommentsTool/

The tool really needs a debug mode, to print more information to the console, at the moment it is stripped back to just showing the result for each object.

(Note: I had to move the text files from their positions in your uncompressed file. For example the Airport.html file was moved into the Airport folder)

If the tool still doesn't work I'll add the debug code for printing out more information.

Edited by: RobM on 14 Jul 2023, 23:35
Removed file
MarkusD

Posts: 642
Registered: 13-Apr-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 14 Jul 23, 14:09   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
(Note: I had to move the text files from their positions in your uncompressed file. For example the Airport.html file was moved into the Airport folder)
I'm not sure if this is correct. All my HTML-files (these are the only files which should be processed anyway) are in the correct folder. Remember, I only process folders, not any files.

As you can see here, the source files (HTML) to be processed are all correct:


I used these settings:

and at the end JA crashed.

It looked like this:



Hope this helps.

Just an idea: For my needs it would speed up the process by far if only folders are processed, not files. During the process I see hundreds of file names in the status bar of JA, none of the files are processed anyway.

Do you think you can add two new options:
[X] process files
[ ] process folders


This would be the default. I for my self would use
[ ] process files
[X] process folders

instead.

Thanks.
MarkusD

Posts: 642
Registered: 13-Apr-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 14 Jul 23, 14:18   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
If the tool still doesn't work I'll add the debug code for printing out more information.
I think this is a good idea. As far as I remember the following line always worked:
IO.writeMapFile(defaultTextToCommentsProperties, defaultTextToCommentsSettings);


So I assume any of these commands will sometimes go wrong:
//All done, tell the user what happened
explorer.context.viewFolder(explorer.context.currentFolder);
window.albumExplorer.refreshAction.actionPerformed(null);
System.out.println("All text data matching " + count + " album object(s) added"); // !MD
window.statusBar.setText("TextToComments processing complete");
JOptionPane.showMessageDialog(window, "<html>All text data matching " + count + " album object(s) added<br>Refresh the view if changes are not apparent<br>See System console for a list of found text data</html>", "Result", JOptionPane.INFORMATION_MESSAGE); // !!MD


What would happen if we drop these lines?
explorer.context.viewFolder(explorer.context.currentFolder);
window.albumExplorer.refreshAction.actionPerformed(null);


I don't have a problem to press <F5> after the tool has finished.
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 14 Jul 23, 14:53   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
MarkusD wrote:
So I assume any of these commands will sometimes go wrong:
//All done, tell the user what happened
explorer.context.viewFolder(explorer.context.currentFolder);
window.albumExplorer.refreshAction.actionPerformed(null);
System.out.println("All text data matching " + count + " album object(s) added"); // !MD
window.statusBar.setText("TextToComments processing complete");
JOptionPane.showMessageDialog(window, "<html>All text data matching " + count + " album object(s) added<br>Refresh the view if changes are not apparent<br>See System console for a list of found text data</html>", "Result", JOptionPane.INFORMATION_MESSAGE); // !!MD
No, none of those lines should go wrong.
What would happen if we drop these lines?
</div>
You need to keep at least the last line, otherwise you won’t know the tool has finished running.
<div class="jive-quote">explorer.context.viewFolder(explorer.context.currentFolder);
window.albumExplorer.refreshAction.actionPerformed(null);

I don't have a problem to press <F5> after the tool has finished.

Those two lines will process very quickly, but you could rem them out. Personally, I like to see the view updated. Most tools I make are to either do something not supported or save time when doing repetitive things. Why press a key if you don’t have to? ;)

I’ll update the tool to add a choice of files or folders and add debug option too.
MarkusD

Posts: 642
Registered: 13-Apr-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 14 Jul 23, 19:32   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
MarkusD wrote:
What would happen if we drop these lines?
</div>
You need to keep at least the last line, otherwise you won’t know the tool has finished running.
<div class="jive-quote">explorer.context.viewFolder(explorer.context.currentFolder);
window.albumExplorer.refreshAction.actionPerformed(null);

I did that and will have a look what happens.

I don't have a problem to press <F5> after the tool has finished.
Those two lines will process very quickly, but you could rem them out. Personally, I like to see the view updated. Most tools I make are to either do something not supported or save time when doing repetitive things. Why press a key if you don’t have to? ;)

You are absolutely right :-)

I’ll update the tool to add a choice of files or folders and add debug option too.
Thanks!

BTW. I commented this line out:
//!!MD			window.statusBar.setText("Reading line " + strLine + " of " + f.toString());
So only the files which are processed are showing up in the status bar, which is fine for me.
RobM

Posts: 3,838
Registered: 4-Aug-2006
Re: textsToComments.groovy -> Crahs with lot of files/folders
Posted: 15 Jul 23, 00:43   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
OK, I'm ready to admit defeat, but attached is an updated version that has the option of files, folders or both. The debug option works, but on my old machine it runs slow.

If every folder has an image file, set as the thumbnail it works. If any folder does not have a thumbnail image, or has a broken link to the image I get failures. No idea why that makes a difference, but it does.

I haven't fully tested the files, folders or both function, just a quick try of files or folders selected.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums