Merge lp:~artem-anufrij/noise/Bugfix-1357465 into lp:~elementary-apps/noise/trunk

Proposed by Artem Anufrij
Status: Merged
Approved by: Corentin Noël
Approved revision: 1679
Merged at revision: 1685
Proposed branch: lp:~artem-anufrij/noise/Bugfix-1357465
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 35 lines (+16/-4)
1 file modified
src/LocalLibrary.vala (+16/-4)
To merge this branch: bzr merge lp:~artem-anufrij/noise/Bugfix-1357465
Reviewer Review Type Date Requested Status
Corentin Noël Approve
Cody Garver (community) Needs Fixing
Review via email: mp+235048@code.launchpad.net

Commit message

Check for duplicates before importing.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

We prefer to update the translation templates after a branch gets merged so that it does not pollute the diff

So please bzr revert -r 1673 po/

review: Needs Fixing
1675. By artem-anufrij

bzr revert -r 1673 po/

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

done

Revision history for this message
Corentin Noël (tintou) wrote :

Please fix the codestyle, brackets should remain on the same line.
For example:
if () {

} else {

}

review: Needs Fixing
1676. By artem-anufrij

fixed code style

Revision history for this message
Artem Anufrij (artem-anufrij) wrote :

Hey Corentin,

please check the code style.

Revision history for this message
Corentin Noël (tintou) wrote :

Only a small thing remaining and it's fine

1677. By artem-anufrij

fixed 'if-else' code style

1678. By artem-anufrij

Remove unused code

1679. By artem-anufrij

fixed code style

Revision history for this message
Corentin Noël (tintou) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/LocalLibrary.vala'
2--- src/LocalLibrary.vala 2014-07-03 19:01:33 +0000
3+++ src/LocalLibrary.vala 2014-10-04 21:39:48 +0000
4@@ -236,9 +236,21 @@
5 var file = File.new_for_path (folder);
6 FileUtils.count_music_files (file, files);
7 }
8- fo.resetProgress (files.size - 1);
9- Timeout.add (100, doProgressNotificationWithTimeout);
10- fo.import_files (files, FileOperator.ImportType.IMPORT);
11+
12+ foreach (var m in get_medias ()) {
13+ if (files.contains (m.uri))
14+ files.remove (m.uri);
15+ }
16+
17+ if (!files.is_empty) {
18+ fo.resetProgress (files.size - 1);
19+ Timeout.add (100, doProgressNotificationWithTimeout);
20+ fo.import_files (files, FileOperator.ImportType.IMPORT);
21+ } else {
22+ debug ("No new songs to import.\n");
23+ finish_file_operations ();
24+ App.main_window.show_notification (_("All music files are already in your library"), _("No files were imported."));
25+ }
26
27 Idle.add ((owned) callback);
28 });
29@@ -806,4 +818,4 @@
30 return false;
31 });
32 }
33-}
34+}
35\ No newline at end of file

Subscribers

People subscribed via source and target branches