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

Implement ToDos - unify and conditionalize file write #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

RossTheHammer
Copy link

Functionize logic, unify writing to output file, make writing conditional to improve performance, add limited/partial Windows support

Copy link

@kiisu-dsalyss kiisu-dsalyss left a comment

Choose a reason for hiding this comment

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

tried out the PR...


FormatAndWriteTitle(){
currentTitle=$(
echo "$1" |

Choose a reason for hiding this comment

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

this echo breaks the song title resulting in no output.

Copy link
Author

Choose a reason for hiding this comment

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

I've changed how this works, now using a regex to extract the track title, but it still uses an echo to feed the pipe. It works fine on my GNU Bash, what environment are you running it in?

cut -d\| -f1 |
sed 's/,/ -/' |
awk '{ print tolower($0) }' |
ascii2uni -aU -q|

Choose a reason for hiding this comment

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

doesn't work with some characters such as in
V ∴ V ∴ V (Headless Horseman Remix),
¿Can You Hear Me?

when a song title with these characters show up sed barfs with "sed: RE error: illegal byte sequence"

Copy link
Author

@RossTheHammer RossTheHammer Mar 23, 2021

Choose a reason for hiding this comment

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

That's interesting, the sed line has not been altered from the original and clearly works for Viktor, and also works fine for me (on Windows under GNU Bash).

Copy link
Author

Choose a reason for hiding this comment

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

I just pushed a change to move the unicode conversion much earlier in the flow, which will hopefully fix the issues you're seeing. Unfortunately, I don't have an environment where I can test it, so it's a blind change.

…acted from window title to use a regex to be more easily adapted to other tools besides Mixxx
if [ $OS == "Linux" ]; then
xdotool search --name "\| Mixxx" getwindowname |
cut -d\| -f1 |
quartzListAllWindows=$'import Quartz\nprint(Quartz.CGWindowListCopyWindowInfo(Quartz.kCGWindowListExcludeDesktopElements|Quartz.kCGWindowListOptionAll,Quartz.kCGNullWindowID))'

Choose a reason for hiding this comment

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

better than quartz...db query, the db path will be different for windows/whatever for mac:

sqlite3 ~/Library/Application\ Support/Mixxx/mixxxdb.sqlite "select library.artist, library.title, library.year from library where library.id = (select PlaylistTracks.track_id from PlaylistTracks where id = (select max(id) from PlaylistTracks));"

Copy link

@kiisu-dsalyss kiisu-dsalyss Mar 24, 2021

Choose a reason for hiding this comment

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

was forced to figure this out as quartz was causing mixxx to freeze for me at random for who knows why, my setup is "quirky"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants