-
Notifications
You must be signed in to change notification settings - Fork 29
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
Feature/report progress #23
Open
carlasplund
wants to merge
30
commits into
robinbowes:develop
Choose a base branch
from
carlasplund:feature/report_progress
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/report progress #23
carlasplund
wants to merge
30
commits into
robinbowes:develop
from
carlasplund:feature/report_progress
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added option "--copyfiles" (Copy non-flac files to dest directories) When this option is selected, non-flac files present in the source directories are copied to the target directories (which, for some, is another way of handling album art). Copying only takes place when the source and target md5 hashes don't match.
This reverts commit e3e89eb.
Non-flac files ar no longer copied by default.
Preparing for a a new fresh start with git flow, therefore resetting 'master' to match Robins 'develop' branch as of 2013-03-09
testing to pull request from Robin to match his 'develop' branch
Logitech Media Sever to cope with it.
Define a new subroutine msg_info which prints messages to screen only if option{info} is true. No need to use the check to info flag ( $Options{info} && msg(...) ) every time something is to be displayed. Also fix a few bugs, where message output was not properly suppressed with the --quiet option set.
With both --copy and --pretend options selected a directory could sometimes be created in destination (it shouldn't be possible).
As a service to windows users, the paths to typical locations of lame and flac are provided. These will work for most (intended for people who haven't included these paths into the envionment variables).
Functionality is unchanged, but the way source and target file paths are retrieved is more generalized. This is an intermediary step towards the implementation of the "--delete" option.
This option works as the --delete option in "rsync": it deletes surplus files and directories in the destination, keeping in perfect sync with the source dir.
Improve readabiliy of the main program by moving the code for (non-flac) file copying to a subroutine.
In a first step towards progress reporting during transcoding, refactor code for the 'path_and_conversion' sub. The checking of flags that determine whether a file should be transcoded is lifted into this sub from 'transcode_file'. The latter sub therefore loses a wrapping if-statement and consequently also loses an indentation step, which makes the changeset look much messier than it actually is. The sub 'convert_file' is no longer used.
In this second step towards progress reporting the messages from transcoding and tagging are not display immediately on screen, but saved to an array variable and displayed once the respective forked child exits. Without this step, there is no real control over the order by with the messages appear when using several parallel processes, and progress reporting would look a complete mess. A callback subroutine is used to output the messages. It is called via the method 'run_on_finish' from the module Parallel::Forkmanager.
In the third step towards progress reporting, two separate loops are used instead of one. The first loop is non-parallelized, where we check each file for need of transcoding. If it doesn't need to be transcoded it is tagged, if necessary. If it does need to be transcoded its name and filesize is saved in a datastructure, but no more processing on the file takes place until the second loop. The progress of this loop is displayed and updated in 1 s intervals. In the second loop, parallel processing is used to transcode the files found in the first loop. Here, in the coming steps 4 and 5, we will extend the 'run_on_finish' callback sub to also include progress reporting and estimated time to finish, based on timing and file size data. Nothing would be gained by having the first loop similarily parallelized - the computational overhead is far too big in comparison to the relatively light cpu load.
Display total flac file size to convert before transcoding begins (in units of MB), as well as a progress report after each transcoded file (as in "Processed 3/1267 files."). This is accomplished by extending the callback code that runs every time a child exits. The timing and estimated finish time of the transcoding job is implemented by extending this callback code further in the next commit, step 5/5.
robinbowes
force-pushed
the
develop
branch
2 times, most recently
from
December 23, 2014 00:18
fdbfca0
to
ae49d07
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
progress report after each transcode (step 4/5)
Display total flac file size to convert before transcoding
begins (in units of MB), as well as a progress report after
each transcoded file (as in "Processed 3/1267 files."). This
is accomplished in the callback code that runs
every time a child exits.
The timing and estimated finish time of the transcoding job is
implemented by extending this callback code further in the
next commit, step 5/5.