Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open file location of best match #106

Merged
merged 1 commit into from
Mar 2, 2023
Merged

Conversation

Borewit
Copy link
Owner

@Borewit Borewit commented Feb 23, 2023

In the closest match search results, add a context menu to match results to open the file location of the best match

Resolves #80

@Borewit Borewit added the enhancement Request or implementation of new feature label Feb 23, 2023
@Borewit Borewit self-assigned this Feb 23, 2023
@Borewit
Copy link
Owner Author

Borewit commented Feb 23, 2023

Build listFix_2.6.0-[PR106]-5.exe

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from 875d5cd to 7324eec Compare February 24, 2023 11:18
@touwys
Copy link

touwys commented Feb 24, 2023

listFix_2.6.0-[PR106]-5

Quickly tested only these functions:

Steps:

  1. Open a playlist in its PLE tab.

  2. Select 11 broken tracks in the playlist presented.

  3. Right-click, select "Find Closest Matches" from the context menu.

  4. The "Select Closest Matches" dialogue opens, and presents the matching tracks it has found:

  5. Click Preview / Play on any of the tracks.

5.1 "Play" is now dysfunctional again — the tracks do not open in the default music player.

  1. Right-click on a track-title in Original Name column (in the "Select Closest Matches" dialogue), to activate "Open match file location":

6.1 This action found the locations for only 3 out of the 11 tracks tested. Thus, failed on 72%+

ℹ️ Please affirm that the action "Open match file location" (ref. 6), is designed to open the location of the matching track that is current in the "Matched Name" column. That is, it will locate the file location of each matched file, as it is being presented by working though the drop-down list. It is vital that it operates this way.

ℹ️ Comment: As the work flow continues to improve, the lack of a visible link between the playlist active (i.e. currently selected) in the PLE and its counterpart displayed in the PLD, hinders. Hopefully, this does not present a major obstacle for you to fix?


rollingfile.log

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from 7324eec to 50aa70b Compare February 25, 2023 09:48
@Borewit
Copy link
Owner Author

Borewit commented Feb 25, 2023

5.1 "Play" is now dysfunctional again — the tracks do not open in the default music player.

I cannot reproduce that problem.

6.1 This action found the locations for only 3 out of the 11 tracks tested. Thus, failed on 72%+

I cannot reproduce that neither, I have tested a few playlists and they all repair just fine.

ℹ️ Please affirm that the action "Open match file location" (ref. 6), is designed to open the location of the matching track that is current in the "Matched Name" column. That is, it will locate the file location of each matched file, as it is being presented by working though the drop-down list. It is vital that it operates this way.

I can confirm that I take new matched track (playlist item) location, from the current selected match.

ℹ️ Comment: As the work flow continues to improve, the lack of a visible link between the playlist active (i.e. currently selected) in the PLE and its counterpart displayed in the PLD, hinders. Hopefully, this does not present a major obstacle for you to fix?

I did not bother me actually. I have similar layout for my development environment application, project files on the left side, tabs with files open on the right, and there is no synchronization in the selection among the two. But there is function to resolve the file I am editing in the file tree, which I use very frequently. Different issue though.

@touwys
Copy link

touwys commented Feb 26, 2023

I can confirm that I take new matched track (playlist item) location, from the current selected match.

So, just to be sure, when there are 10 matched tracks listed in the drop-down list next to the unmatched track, and then say unmatched track number 3 in the drop-down list is selected for the match, the location for unmatched track number 3 will have to open on demand?

I did not bother me actually. I have similar layout for my development environment application, project files on the left side, tabs with files open on the right, and there is no synchronization in the selection among the two.

I agree that it may not be essential to operations, but maintaining a synchronised link between the two certainly is reassuring.

I cannot reproduce that problem.

See: #114 (comment)

@Borewit
Copy link
Owner Author

Borewit commented Feb 26, 2023

So, just to be sure, when there are 10 matched tracks listed in the drop-down list next to the unmatched track, and then say unmatched track number 3 in the drop-down list is selected for the match, the location for unmatched track number 3 will have to open on demand?

I think I understand why you ask the question. If you select another track out of the suggested matches, it keeps opening the previous selected match. Only after you click outside the combobox (drop down for picking alternative matches), the selection get updated, and then it will open that file location. Is that it?

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from 50aa70b to 832fcdc Compare February 26, 2023 12:25
@@ -476,6 +496,17 @@ private void initComponents()
_uiScrollPane.setViewportView(_uiTable);

add(_uiScrollPane, java.awt.BorderLayout.CENTER);

_playlistEntryRightClickMenu = new javax.swing.JPopupMenu();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7% of developers fix this issue

UnnecessarilyFullyQualified: This fully qualified name is unambiguous to the compiler if imported.


Suggested change
_playlistEntryRightClickMenu = new javax.swing.JPopupMenu();
private JPopupMenu _playlistEntryRightClickMenu;

❗❗ 3 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
src/main/java/listfix/view/controls/ClosestMatchesSearchScrollableResultsPanel.java 502
src/main/java/listfix/view/controls/ClosestMatchesSearchScrollableResultsPanel.java 31
src/main/java/listfix/view/controls/ClosestMatchesSearchScrollableResultsPanel.java 32

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@sonatype-lift
Copy link

sonatype-lift bot commented Feb 26, 2023

🛠 Lift Auto-fix

Some of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1

# Download the patch
curl https://lift.sonatype.com/api/patch/github.com/Borewit/listFix/106.diff -o lift-autofixes.diff

# Apply the patch with git
git apply lift-autofixes.diff

# Review the changes
git diff

Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command:

curl https://lift.sonatype.com/api/patch/github.com/Borewit/listFix/106.diff | git apply

Once you're satisfied, commit and push your changes in your project.

Footnotes

  1. You can preview the patch by opening the patch URL in the browser.

@touwys
Copy link

touwys commented Feb 26, 2023

I think I understand why you ask the question. If you select another track out of the suggested matches, it keeps opening the previous selected match. Only after you click outside the combobox (drop down for picking alternative matches), the selection get updated, and then it will open that file location. Is that it?

I'm using release listFix_2.6.0-PR114-5 where this function is no longer available. Hence, I can only confirm that "If you select another track out of the suggested matches, it keeps opening the previous selected match". This part remains untested: "Only after you click outside the combobox (drop down for picking alternative matches), the selection get updated, and then it will open that file location".

What are the results at your end?

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from 832fcdc to c1e3547 Compare February 27, 2023 10:34
@Borewit
Copy link
Owner Author

Borewit commented Feb 27, 2023

I have now rebased this branch / PR. I have also fixed all of the sonatype-lift bot recommendations. Do not expect much miracles to happen from the changes based on his suggestions.

I still need to have a look if I can better handle the selection change.

Build: listFix_2.6.0-PR106-9.exe

@touwys
Copy link

touwys commented Feb 27, 2023

I have now rebased this branch / PR. I have also fixed all of the sonatype-lift bot recommendations. Do not expect much miracles to happen from the changes based on his suggestions.

I still need to have a look if I can better handle the selection change.

Build: listFix_2.6.0-PR106-9.exe

I am onto it. In my book, the opening of matched file locations is an essential operation.

The sonatype-lift bot recommendations are out of my field of play. 👽

@touwys
Copy link

touwys commented Feb 27, 2023

Test Results for listFix_2.6.0-PR106-9

Steps:

1. Open 3 playlists, from various sources, in the PLE.

2. Open File / Options / Theme and change default to "Darkstar".

2.1 The 3 playlist tab-titles disappear.

2.2 Change the Theme back to the default, and the tab-titles are still blank.

3. Select Closest Matches dialogue activated to test Open File Location:

3.1 More often than not, the explorer window that opens to the selected match, — that is, any match selected from the matches presented in the drop-down list — opens and shuts instantly. Repeating the exercise, with the same match, subsequently opens the correct location.

3.2 The matched file, once located, is inconsistently highlighted for easy identification amongst the other files. More often than not, the located file is not getting highlighted at all.


❓ Why is the action Open File Location, in the Select Closest Matches dialogue, not performed by right-clicking on the most current match in the drop-down list of matched files, in the Matched Name column? This certainly is the most sensible, intuitive place, to look for it to perform the operation. Instead, it is performed by right-clicking on the Original Name for which the file supposedly does not even exist.


@Borewit Borewit force-pushed the open-file-location-of-best-match branch from c1e3547 to eb46394 Compare February 27, 2023 18:10
@Borewit
Copy link
Owner Author

Borewit commented Feb 27, 2023

❓ Why is the action Open File Location, in the Select Closest Matches dialogue, not performed by right-clicking on the most current match in the drop-down list of matched files, in the Matched Name column? This certainly is the most sensible, intuitive place, to look for it to perform the operation. Instead, it is performed by right-clicking on the Original Name for which the file supposedly does not even exist.

No it was not using the original filename, but their was weird propagation from the selection, causing the accessible selection to be kind of step behind. I made that more direct, and the context menu will be triggered from the combo-box as well: listFix_2.6.0-PR106-11.exe

@touwys
Copy link

touwys commented Feb 28, 2023

No it was not using the original filename, but their was weird propagation from the selection, causing the accessible selection to be kind of step behind. I made that more direct, and the context menu will be triggered from the combo-box as well: listFix_2.6.0-PR106-11.exe

👍🏻 OK, thanks for explaining that.

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from eb46394 to 8441db6 Compare February 28, 2023 07:59
@touwys
Copy link

touwys commented Feb 28, 2023

Test Results: listFix_2.6.0-PR106-11

1. Changing the theme at File / Options / Theme clears the tab-titles of all the playlists opened in the Editor.

1.1 Closing all tabs, and resetting the theme to default, and opening the tabs again, will restore the tab-titles that were previously cleared upon changing the theme. Repeating the process, will often hang the programme, which then has to be closed, forcefully.

2. Still clicking on the title of the unmatched track located under the Original Name column, in order to locate the matched track located right next to it in the Matched Name column, drop-down list.

2.1 Working down the list of unmatched tracks in the Original Name column, one at a time, they all presented exactly the same matched track location for each one.


ℹ️ The drag and drop of playlists from the PLD onto PLE, is a very nice touch, which I have not noticed before. Great idea!

❓ Going back several preceding releases, the PR number has been dropped from the start-up & name tag? The PR- indication helps to keep perspectives relative while testing.



rollingfile.log

@touwys
Copy link

touwys commented Feb 28, 2023

@Borewit:

Please check the preceding post. Log-file now added, which I forgot. 😌

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from a044238 to 6abde5d Compare February 28, 2023 10:09
@Borewit
Copy link
Owner Author

Borewit commented Feb 28, 2023

Changing the theme at File / Options / Theme clears the tab-titles of all the playlists opened in the Editor.

Please report is a new issue as I don't think it is introduced with this PR.

Closing all tabs, and resetting the theme to default, and opening the tabs again, will restore the tab-titles that were previously cleared upon changing the theme. Repeating the process, will often hang the program, which then has to be closed, forcefully.

New issue

  1. Still clicking on the title of the unmatched track located under the Original Name column, in order to locate the matched track located right next to it in the Matched Name column, drop-down list.

2.1 Working down the list of unmatched tracks in the Original Name column, one at a time, they all presented exactly the same matched track location for each one.

Yes, it opens the location of the current selected match, anywhere on that row. That's what it also says in the context menu "Open match file location".

Selecting one of the alternative location is tricky, as they appear somewhere in the drop down, then on top that floating drop down I would have show another floating context menu. If you want to know the file location of the alternative, there is already the tooltip.

Going back several preceding releases, the PR number has been dropped from the start-up & name tag? The PR- indication helps to keep perspectives relative while testing.

The version is now totally dynamically being added. The version is not aware on which branch it is. I can add the commit hash, to make it unique. Adding the PR's to the installations I do by hand.

Latest build of this PR, rebased on other merged PR: listFix_2.6.0-PR106-16

I propose to do a regression test after you approve this PR. Aiming to nail problems already merged into the default branch. So aiming for any kind of bugs.

Update: this introduced a bug

@touwys
Copy link

touwys commented Feb 28, 2023

Yes, it opens the location of the current selected match, anywhere on that row. That's what it also says in the context menu "Open match file location".

I think we have a misunderstanding here? Let's say there are three unmatched tracks listed in the Original Name column, called —

Track One
Track Two
Track Three

Each one of the aforesaid, has 10 matched tracks listed in the relevant drop-down box situated next to it in the Matched Name column.

  1. Call the context menu for Track One and select Open match file location for the very first match presented next door in the drop-down list.

1.1 This opens Location A

  1. Select the next matched track in the drop-down list for Track One.

2.1 This opens Location A

2.2 Thus, the same location repeats for all the matched track in the drop-down list.

  1. Call the context menu for Track Two and select Open match file location for the very first match presented next door in the drop-down list.

3.1 This opens Location A

  1. Select the next matched track in the drop-down list for Track Two.

4.1 This opens Location A

...and so forth. So whatever match gets selected, each one of them, irrespective of which unmatched track is selected, will call exactly the same location. i.e. Location A.


@Borewit
Copy link
Owner Author

Borewit commented Feb 28, 2023

Ah yes, I see what you mean, it still doesn't update to the last selection. Still some work to do.

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from 97ad4ed to 6fa594a Compare February 28, 2023 12:54
@touwys
Copy link

touwys commented Feb 28, 2023

Testing listFix_2.6.0-PR106-16

I had a quick run with this build before the power grid went down again:

After a clean install, the Media Directory was added, immediately followed by dragging and dropping two playlist folders to the PLD. The very next step was to open a playlist via the File Context Menu, from the media library, directly into the PLE.

This caused listFix to hang (@ screenshot), so that it had to closed forcefully, again.

Observation: The most likely cause for this is that the playlist I was trying to open, was pre-existing in one of the PLD-folders. If so, it has to be safeguarded against.

Sorry, no log file yet. 😢

Screenshot_20230228 _ listfix playlist hangs

@Borewit
Copy link
Owner Author

Borewit commented Feb 28, 2023

That release got some nasty bugs, sorry about that. Made a few typo's in button image references, introduced in #121.
No need for a log file.

@touwys
Copy link

touwys commented Feb 28, 2023

That release got some nasty bugs, sorry about that. Made a few typo's in button image references, introduced in #121. No need for a log file.

No problem. Upon restart, I can confirm that opening a playlist from anywhere, causes the app to hang. So my preceding comment is not valid.

@Borewit Borewit force-pushed the open-file-location-of-best-match branch from 6fa594a to 6dab7e0 Compare February 28, 2023 19:13
@Borewit
Copy link
Owner Author

Borewit commented Feb 28, 2023

This one should have the correct selected match location right: listFix_2.6.0-PR116-17.exe listFix_2.6.0-PR106-17.exe

@touwys
Copy link

touwys commented Mar 1, 2023

This one should have the correct selected match location right: listFix_2.6.0-PR116-17.exe

Thank you, I envisage testing the aforesaid PR, today. Have uploaded this schedule for you to take a peek at.

👉🏻 Update: The release is unavailable at the link provided?

@Borewit
Copy link
Owner Author

Borewit commented Mar 1, 2023

Ah crap, correction: listFix_2.6.0-PR106-17.exe

@touwys
Copy link

touwys commented Mar 2, 2023

Testing: listFix_2.6.0-PR106-17

✔️ The fix is in for Open match file location.


The following are additional points of observation — some of which have previously popped up. Please indicate which of these you wish to have posted under issues:

  1. The tab-labels still go blank, once the theme is changed at `File / Options / Theme. However, I am unsure if that is the sole cause — there might be other reasons left to discover?

  2. Changing the theme may also cause the app to hang. After the restart, the newly chosen theme is active, and opening the same playlists tabs in the PLE, the tab-titles return.

  3. If all the playlist-tabs with blank titles are closed simultaneously (Ctrl+Shift+W), and the same playlists are then reopened, the tab-titles text return.

  4. Sometimes, changing the font style will cause the app to hang.

  5. Darkstar Theme > Select Closest Matches dialogue > Matched Name dropdown box: Issue — matched tracks text are unreadable.

  6. Select Closest Matches dialogue: Issue with the size of the PLAY-tab buttons in the Preview / PLAY column. The buttons become all squeezed together with Font-style changes.


❓ How does listFix() search for a matched track — by music file tags, or the file description?


@Borewit: Here is the log: 🤕

rollingfile.log


@Borewit Borewit merged commit a452d74 into main Mar 2, 2023
@Borewit
Copy link
Owner Author

Borewit commented Mar 2, 2023

question How does listFix() search for a matched track — by music file tags, or the file description?

For sure not using metadata tags. There is no functionality present in listFix() software to extract audio tags. In the dependent library lizzy, which is the other project I adapted to eliminate all vague non open source dependencies used.

lizzy actually is, sort of able to read tags, relying on some a ffmpeg Java component which is relying on a native (non-Java) ffmpeg installation. Yet that whole ffmpeg part is excluded from this dsitribution.

The "closest match" is purely based on the filename portion of the audio track, so excluding the parent folder.

public int score(String filename1, String filename2)
{
return scoreMatchingTokens(splitFileName(filename1), splitFileName(filename2));
}

This score function is chopping the file name into words, e.g.: "01 Madonna - Like a Prayer.mp3" becomes something like: ["01", "Madonna" , "Like", "Prayer"].

scoreMatchingTokens function is then comparing these words, in each track in your library, also converted to a similar list of words. Then a score is basically calculated comparing those sets of words.

  1. The tab-labels still go blank, once the theme is changed at `File / Options / Theme. However, I am unsure if that is the sole cause — there might be other reasons left to discover?
  2. Changing the theme may also cause the app to hang. After the restart, the newly chosen theme is active, and opening the same playlists tabs in the PLE, the tab-titles return.
  3. If all the playlist-tabs with blank titles are closed simultaneously (Ctrl+Shift+W), and the same playlists are then reopened, the tab-titles text return.
  4. Sometimes, changing the font style will cause the app to hang.

I suggest to combine those in one new issue

Darkstar Theme > Select Closest Matches dialogue > Matched Name dropdown box: Issue — matched tracks text are unreadable.

I noticed that. Not sure where that is coming from. If it the a Java theme which is essentially just shit, I am not very motivated to repair it. Then rather disable the most problematic themes The GUI also looks totally different on Linux (at least with some themes), so it very sensitive for the OS flavor it is running on.

Investigating to port the entire GUI to a more modern alternative like (https://openjfx.io/)[https://openjfx.io/]. But this is a massive effort.

But you can always capture your wishes in issues. Java GUI's not my biggest strength, maybe some other developers wants to contribute, although I this very project very little probability to be picked as the user community is very tiny.

@touwys
Copy link

touwys commented Mar 2, 2023

5. Darkstar Theme > Select Closest Matches dialogue > Matched Name dropdown box: Issue — matched tracks text are unreadable.

Thank you for your dedication, comments, and answers to my questions.

Before I go ahead to respond more fully to the aforesaid point you have made, I wish to discuss something with you —

Simply put, I agree with you that fixing some of the issues related the GUI -- such as the one with the Darkstar theme, which is quoted above — is not really worth the effort. ListFix() is a tool, not a fanfare. Therefore, I suggest that you drop all the current themes from Options. Simply stick to the default. You can streamline the default theme to your heart's content as, and when, the need arises. With only one theme to work with, it will allow you to focus on fine-tuning the operational side of things. That is what a good tool is designed for, and what it should do, precisely. My guess is that quite a few issues could disappear along with the superfluous themes.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request or implementation of new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "Open File Location" action is absent from the "Select Closest Matches" Dialogue
2 participants