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

Exported part filename misses part name, if only single part is exported #21161

Open
sammik opened this issue Jan 23, 2024 · 4 comments
Open
Assignees
Labels
P2 Priority: Medium regression Regression on a prior release

Comments

@sammik
Copy link
Contributor

sammik commented Jan 23, 2024

Issue type

Import/export issue

Bug description

  • If exporting score, file is saved as Score.pdf
  • if exporting multiple parts (or score and parts), parts are saved as Score-part1Name.pdf, Score-part2Name.pdf
  • but if exporting only sinlge part, it is saved as Score.pdf

Steps to reproduce

  1. create score
  2. create parts
  3. export score
  4. export single part - see, score is overwritten, instead of named part is written

Screenshots/Screen recordings

No response

MuseScore Version

master

Regression

Yes, this used to work in a previous version of MuseScore 4.x

Operating system

Ubuntu 22.04

Additional context

worked right in 4.0.2
stopped working in 4.1

@muse-bot muse-bot added the regression Regression on a prior release label Jan 23, 2024
@bkunda bkunda added the P1 Priority: High label Jan 23, 2024
@cbjeukendrup
Copy link
Contributor

cbjeukendrup commented Jan 23, 2024

This is intentional, but can be changed of course

To elaborate: if only one file will be created, the filename entered by the user is used, because that seems expectable.

@cbjeukendrup
Copy link
Contributor

Actually, each possible behaviour has its problems / different users will have different expectations in different situations.

Dorico's solution is much more clever and eliminates all possible ambiguities:

  1. Select target folder where you want the files to be created
  2. Choose filename pattern, for example "my score - $partName - $pageNumber" where $partName and $pageNumber are replaced with the appropriate part name and page number for each exported file being created.

@bkunda
Copy link

bkunda commented Jan 24, 2024

I think the simplest solution here is simply to ensure MuseScore adopts the "my score - $partName" pattern by default, even if only one part is selected for export.

We can explore offering more possibilities later, but this would at least address the bug.

I'm not too worried about this one though because the only thing that could get overwritten is the exported PDF; the original MuseScore file remains unaffected (obviously).

We should certainly fix it, but it's perhaps not as urgent as I deemed it to be yesterday.

@bkunda bkunda added P2 Priority: Medium and removed P1 Priority: High labels Jan 24, 2024
@PhilippeRigault
Copy link

PhilippeRigault commented Feb 12, 2024

The naming problem not only affects exports of a single part, but also all exports of multiple parts combined in one file, which is worse IMO as it can result in the very same export creating different files when executed more than once.

For example:

  1. when exporting score and parts in one file:
  • if this is the first export since opening MS, the filename is (correctly) set to SCORENAME-Score_and_Parts.pdf
  • otherwise, the filename is (incorrectly) set to SCORENAME.pdf
  1. when exporting multiple parts (but not the score) in one file:
  • if this is the first export since opening MS, the filename is (correctly) set to SCORENAME-Parts.pdf
  • otherwise, the filename is (incorrectly) set to SCORENAME.pdf

When users performs an export several times with the exact same parts/file selections, they expect that these exports will all update the same file. The current behaviour very easily leads to outdated and inconsistent files for the user.

As far as I could tell, the problem lies in the function ExportProjectScenario::askExportPath()
where

  • the variable filenameAddition is correctly set ("-Score_and_Parts" for case 1., "-Parts" for case 2.)

  • but the filename addition it is ignored later in the function if defaultPath has been set

    if (defaultPath == "") {
    defaultPath = configuration()->defaultSavingFilePath(project, filenameAddition, exportType.suffixes.front().toStdString());
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Priority: Medium regression Regression on a prior release
Projects
Status: Issues to fix
Development

No branches or pull requests

5 participants