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
stats.lua: display file tags #13913
base: master
Are you sure you want to change the base?
stats.lua: display file tags #13913
Conversation
Download the artifacts for this pull request: |
3a68505
to
00f5d26
Compare
You can remove 1 line by looping through |
This cannot be done because the entries in |
I see. You may also want to truncate the fields for who uses |
I added an option to filter out overlength tags, currently the default limit is 128 bytes but can be customized. I don't think it's worthwhile to hardcode some arbitrary lists of metadata to truncate, which is also problematic in itself since Lua before 5.3 has no built-in UTF-8 utils. |
We don't have much vertical space on page 1 of stats.lua, do we really want to add non determined number of lines based on input file? |
2a541ae
to
d71e4a7
Compare
Added another option for the maximum amount of tags to be displayed. I would like to at least display artist and album if available, so I set the limit to 3 tags for now. |
I was thinking about adding new page with track info. Page 1 would be reserved for technical parameters like display/decoding etc. |
It's already displaying the title. I'm OK if you want to move it to a new page but I would like to keep all tags (including title) in one place.
Tags belong to files, not tracks, so I don't think they belong to the track info section. If you want metadata on a new page, it's better for the page to have separate metadata and track info sections. |
d71e4a7
to
a174c84
Compare
Exact split is to be agreed, but I was thinking
and remove Not sure if such page would be useful, maybe not, just thinking how we can display more things. Page 1 is already dense, so we should look at other solutions. |
IMO page 1 should remain displaying mostly dynamic info (aka stats in "stats".lua). Moving the file section away would give us more space for actual stats on page 1 so I think moving the section to a new page for file/track info is a good plan. |
@kasper93
I am thinking about merging this PR first, considering that I have implemented a limit on the tags displayed. Then you can open a PR to add the track info and move the file info on page 1 to that page. What do you think of this plan? |
Sounds reasonable.
Given the current state of things (i.e., we cannot detect if the text overflows the screen - or can we now?) you can always create (or stumble upon) a situation where the stats overflow/cut off, no matter how low your limit is. For a workaround, what about enabling scrolling for page one so users can still work with it if worst comes to worst (additional to your limit)? I don't think it's good UX to expect users to tweak with configuration options in such cases (e.g., |
This adds file tags to display along with the title, including album/artist etc. for music, and series etc. for some videos. The list of tags to display is identical to the tags printed to the terminal and is controlled by the --display-tags option.
To filter out overlength tags (such as long comments and lyrics) and files with too many tags, add file_tag_max_length and file_tag_max_count options so that tags longer than this length are not displayed, and only the first few tags are displayed.
a174c84
to
d67e3bd
Compare
This makes page 1 scrollable with up and down keys. The trick here to avoid a large append parameter refactoring is to make the append function add the table index only if the newline character is not empty. Otherwise, new strings are appended to the existing string.
d67e3bd
to
d64cf0e
Compare
Good suggestion. I added a commit to make page 1 scrollable. |
@na-na-hi: It is very good idea, but I'm not interested in making a new page myself. If I wasn't clear, I don't think there is space on page 1 for more lines (3+). I think we can spare 1 line more, but that's all for this page.
I think page 1 should be designed in a way to fit on one screen. |
You will need to do so anyway for #13866 according to your own limit, won't you? Either in this PR or that one, someone needs to do the job eventually.
It is still useful when someone changes the default font size, the |
Definitely agree. With the right file, you could make it overflow the screen with default font settings even years ago and this hardly got any better over time. ;) |
This adds file tags to display along with the title, including album/artist etc. for music, and series etc. for some videos. The list of tags to display is identical to the tags printed to the terminal and is controlled by the
--display-tags
option.