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

Trackma cuts long anime names #9

Closed
Baitinq opened this issue Sep 3, 2019 · 21 comments
Closed

Trackma cuts long anime names #9

Baitinq opened this issue Sep 3, 2019 · 21 comments

Comments

@Baitinq
Copy link
Contributor

Baitinq commented Sep 3, 2019

When you have an anime in your anime list with a lot of characters (as an example: JoJo's Bizarre Adventure: Stardust Crusaders - Battle in Egypt), fzf shortens it to JoJo's Bizarre Adventure: Stardust Crusaders -, meaning that it will not show up as the first option in the next screen. This isnt a problem right now but if you end up implementing the -y option it could become a problem. (Also it isnt aesthetic to see your anime name shortened like that). I know it is a fzf problem but maybe there is an option to prevent this?

Thanks

EDIT: It also makes it so you cant increase the nr, resulting in a real problem

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

Actually I am not sure why that happens. And is not a fzf issue, seems to be something else.

trackma list

Results into a table as wide as your terminal.

Doesn't look the same and it gets cut:

  • variable:
tlist=$(trackma list) #or tlist=`trackma list`
echo "$tlist"
  • file:
trackma list > list.txt 
cat list.txt

or

trackma list 1> list.txt
cat list.txt
  • tee. Doesn't matter. Both the tee output and tlist var are the same... short.
{ tlist=$(trackma list | tee >(cat - >&5)); } 5>&1
exec > >(tee -ia script.log)
trackma list

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

Should we maybe ask that question on a forum? Because it is indeed super weird

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

Well I did try anything I thought of. I also looked on the trackma issues but honestly didn't find anything. I am starting to think this might be a trackma list thing rather than a bash thing. I even run zsh by default so I really have no idea.
I will open a trackma issue but I don't have my hopes high.

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

Maybe there is some weird character in the trackma list output that makes it do that.

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

I will install trackma-git from the AUR and see.

Also OMG I have my very own entry in the AUR... by you. Thx.

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

Nope still the same. Actually exact same version 0.8.2 between git and pip.

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

@Baitinq I opened the issue as I said. I also have nr 453 as well because trackma has an issue where the missing dot for entry 1 is enough to throw an error. As you know adl strips those dots for processing.

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

Yea hahah I like to have all the programs I use in the aur

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

Ill comment on the issue now to try and make it more visible. Thanks

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

@Baitinq you will also be affected by z411/trackma#453 if you have an anime ending with a .

@RaitaroH RaitaroH changed the title fzf cuts long anime names Trackma cuts long anime names / Trackma update error for titles ending with a dot Sep 4, 2019
@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

Okay thanks for the info, lets hope this gets solved soon.

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

@RaitaroH It seems like someone has found a fix for this. Check the trackma issue page

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

@Baitinq I did look at it. Unfortunately until the PR is merged one needs to go in and change that file on their own, or adl will not even work. I might just add like a custom test just to see if the file was modified... except I used pip --user for that so where I have trackma and where you will have it etc etc are different.
Untill the PR is merged adl remains the same.

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

@Baitinq make the following change get_list() { tlist=$(LINES=25 COLUMNS=130 trackma list | head -n -2 | tail -n +2) ;} and you get the benefits of this.
In my case 90 columns is sufficient. I will go with that for now.

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

I am getting this error when changing that get_list() function

Traceback (most recent call last): File "/usr/bin/trackma", line 11, in <module> load_entry_point('Trackma==0.8.2', 'console_scripts', 'trackma')() File "/usr/lib/python3.7/site-packages/trackma/ui/cli.py", line 1042, in main main_cmd.execute(args.cmd, args.args, args.cmd) File "/usr/lib/python3.7/site-packages/trackma/ui/cli.py", line 782, in execute return func(args) File "/usr/lib/python3.7/site-packages/trackma/ui/cli.py", line 357, in do_list self._make_list(self.sortedlist) File "/usr/lib/python3.7/site-packages/trackma/ui/cli.py", line 877, in _make_list max_title_length = width - col_id_length - col_episodes_length - col_score_length - col_index_length - 5 TypeError: unsupported operand type(s) for -: 'str' and 'int'

Do I have to apply the pull request manually for this to work?

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

I am getting this other error when I apply the patch and change the get_list() function:

Traceback (most recent call last): File "/usr/bin/trackma", line 11, in <module> load_entry_point('Trackma==0.8.2', 'console_scripts', 'trackma')() File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point return ep.load() File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2443, in load return self.resolve() File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python3.7/site-packages/trackma/ui/cli.py", line 34, in <module> from trackma.engine import Engine File "/usr/lib/python3.7/site-packages/trackma/engine.py", line 28, in <module> from trackma import data File "/usr/lib/python3.7/site-packages/trackma/data.py", line 22, in <module> from trackma import utils File "/usr/lib/python3.7/site-packages/trackma/utils.py", line 295 except: ^ SyntaxError: invalid syntax

@RaitaroH
Copy link
Owner

RaitaroH commented Sep 4, 2019

Apply the PR manually of course.

@Baitinq I did look at it. Unfortunately until the PR is merged one needs to go in and change that file on their own, or adl will not even work. 

^^^ I did tell you.

For me the PR works perfectly.

get_list()        { tlist=$(LINES=25 COLUMNS=90 trackma list | head -n -2 | tail -n +2) ;}

image

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

hmm that is so weird

@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 4, 2019

@RaitaroH nvm, I was able to fix it. Thanks

@Baitinq Baitinq closed this as completed Sep 4, 2019
@RaitaroH RaitaroH changed the title Trackma cuts long anime names / Trackma update error for titles ending with a dot Trackma cuts long anime names Sep 6, 2019
@Baitinq
Copy link
Contributor Author

Baitinq commented Sep 9, 2019

@RaitaroH Could you add the LINES=25 COLUMNS=130 to adl? Thanks a lot.

@RaitaroH
Copy link
Owner

@Baitinq thx for notifying me about the merge: z411/trackma@020c0a2

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

No branches or pull requests

2 participants