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

Fix csv rating export #4762

Merged
merged 5 commits into from
May 26, 2022
Merged

Fix csv rating export #4762

merged 5 commits into from
May 26, 2022

Conversation

daschuer
Copy link
Member

Some minor fixes for cvs export.

  • Remove the cover art column with the bas64 encoded bitmap from the output
  • Export play count without ()
  • Export star rating as number

@daschuer daschuer changed the title Csv export Fix csv rating export May 22, 2022
@@ -545,6 +545,16 @@ QVariant BaseTrackTableModel::roleValue(
}
switch (role) {
case Qt::ToolTipRole:
switch (field) {
case ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW:
Copy link
Contributor

Choose a reason for hiding this comment

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

COLUMN_LIBRARYTABLE_PREVIEW is redundant, same as kDataExportRole.

Why do we need to skip COLUMN_LIBRARYTABLE_RATING and COLUMN_LIBRARYTABLE_TIMESPLAYED explicitly instead of simply displaying their value? Then this additional switch/case could be removed, same as before.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did consider the tool-tip on top of the rating stars and the played checkbox as visual clutter.

The use case of the tool-tip is to see the full string if the column is to small.
I have just noticed that this is also possible for these columns.
So I will re-enable the tool-tips.

OK?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have reverted these lines and git ammend

@daschuer
Copy link
Member Author

daschuer commented May 23, 2022

I have also fixed the year column display and exporting.
Before 2022-05-24 was displayed as 2022 while the invalid 20220524 format some tools are using was displayed as it is as well as all other non ISO strings.
Now it displays the column contend as it is. This allows also to understand the sorting results and fix related issues, because the database uses the raw values as string for sorting.

@ronso0 ronso0 added this to the 2.3.3 milestone May 24, 2022
ParserCsv::~ParserCsv() {
} // namespace

ParserCsv::ParserCsv()
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace this redundant definition with a = default; declaration (or no declaration at all if it is implicitly generated).

Q_OBJECT
public:
public:
ParserCsv();
Copy link
Contributor

Choose a reason for hiding this comment

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

The default constructor declaration is probably redundant, see my comment. ~ParserCsv() override = default; would be more appropriate here.

@daschuer
Copy link
Member Author

Done.

Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

I suppose it is ok not to preserve backwards compatibility, because this is just and internal format without any promises regarding its structure. It might break some users' use cases though, e.g. when exporting track lists into Excel for external play logs. Fixing this should be simple for them.

@uklotzde uklotzde merged commit 13ba0ff into mixxxdj:2.3 May 26, 2022
@daschuer
Copy link
Member Author

Thank you. I will take care merging this to main and resolve the conflicts.

@daschuer daschuer deleted the csv_export branch May 4, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants