Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • funkwhale funkwhale
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 379
    • Issues 379
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • funkwhalefunkwhale
  • funkwhalefunkwhale
  • Merge requests
  • !571

Resolve "In-place imports cannot be transcoded"

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Vierkantor requested to merge Vierkantor/funkwhale:688-transcode-inplace into develop Jan 28, 2019
  • Overview 1
  • Commits 6
  • Pipelines 1
  • Changes 4

Closes #688 (closed)

This Merge Request includes:

  • Tests
  • A changelog fragment (cf https://docs.funkwhale.audio/contributing.html#changelog-management)

In-place imported tracks have no audio_file attribute but only a source attribute. The transcoding code assumes that the file has an audio_file attribute, so it failed on these cases.

By splitting the transcoding function into one that takes files, and one that takes pydub.AudioSegment, we can make a method on Upload that gives the AudioSegment, either by reading from self.audio_file.open() or open(self.source).

It looks like transcode_file is not used anywhere else, so it could also be an option to delete it entirely and just preserve the function that takes an AudioSegment. Is the function needed for any planned changes?

Another option would be to allow passing open files to transcode_file, which only opens them if it is needed. I'm not sure how to do this idiomatically.

Edited Jan 29, 2019 by Agate
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 688-transcode-inplace