Adrian Sampson
635052e2ff
Fix #1804 : edit plugin moves files
2016-01-08 15:22:28 -08:00
Adrian Sampson
963a66a40c
Refactor try_sync to also include moving
...
This will remove a bunch of duplication we currently have for moving files
*inside the library directory* when their metadata changes.
2016-01-08 14:56:52 -08:00
Jack Wilsdon
12cd5306b7
Update copyright dates to 2016
2015-12-30 15:42:06 +00:00
Adrian Sampson
69ffb83453
Eliminate some copypasta
2015-11-19 16:26:27 -08:00
Adrian Sampson
f995ab38db
Fix a test and a bug revealed by a test
2015-11-19 16:11:45 -08:00
Adrian Sampson
437959018c
Pass through certain "safe" types to YAML
...
This avoids some round-tripping problems with types (such as ScaledInt) that
are not represented in strings with 100% fidelity. It also makes the syntax
nicer when editing numbers and booleans: they no longer appear to be
needlessly surrounded by quotes in the YAML.
2015-11-19 16:07:20 -08:00
Adrian Sampson
0e20770cc3
Convert YAML keys and values back to strings
...
I hadn't quite realized before that the user could also change the *keys* to
be non-strings too! This also prevents against that by just reinterpreting
everything as strings.
2015-11-19 15:38:20 -08:00
Adrian Sampson
0873d31419
Catch unexpected YAML type
...
We need a sequence of dictionaries back; validate this assumption.
2015-11-19 15:34:49 -08:00
Adrian Sampson
3176b83cd7
Use type-based formatting and parsing
...
All editable values are now strings and are parsed from strings. This closely
matches the behavior of the `modify` command, for example.
2015-11-19 15:25:49 -08:00
Adrian Sampson
775a48eb28
--extra/-e is now --field/-f
2015-11-17 14:40:52 -08:00
Adrian Sampson
b33d25a0ad
--extra option can use any field
...
Not just the built-in fields.
2015-11-17 14:39:40 -08:00
Adrian Sampson
f68dc4652a
Fix a typo
2015-11-17 13:14:15 -08:00
Adrian Sampson
4db91c8bd2
Fix a too-long line
2015-11-16 13:03:50 -08:00
Adrian Sampson
f767f1c2a3
New confirmation prompt
...
We now ask for a trinary edit/apply/cancel confirmation *after* showing the
updates. This lets you decide whether you're done based on a "preview" of the
changes and keep editing if they don't look right.
2015-11-16 13:01:24 -08:00
Adrian Sampson
d87a747477
Condense edit plugin documentation
...
Also avoided adding some unused command-line options.
2015-11-16 12:43:59 -08:00
Adrian Sampson
c679e3f307
Merge branch 'editor' of github.com:sampsyo/beets into editor
2015-11-16 12:28:35 -08:00
Adrian Sampson
feabf1a6ef
Offer a chance to fix YAML parse errors
...
An alternative to 749ef85638 by @jmwatte.
2015-11-16 12:27:32 -08:00
jmwatte
bb39cd509d
cleaned up edit.rst
2015-11-16 10:37:38 -08:00
Diego Moreda
917628340e
edit: save only items with changes
...
* Modify save_write() so only the items that do have pending changes (ie. dirty
items) are saved to the database.
2015-11-16 14:48:05 +01:00
Adrian Sampson
cfba04bc9d
Don't ask for confirmation if nothing changed
2015-11-14 14:58:53 -08:00
Adrian Sampson
80facbab6f
More robust forbidden-change detection
2015-11-14 14:57:32 -08:00
Adrian Sampson
1c44969255
Simplify interfaces and add docs
2015-11-14 14:50:24 -08:00
Adrian Sampson
eb1bb132b1
Simplify metadata application
2015-11-14 14:48:10 -08:00
Adrian Sampson
58205e1bef
Simplify data filtering
2015-11-14 14:33:04 -08:00
Adrian Sampson
029915814b
Abort if nothing changed
2015-11-14 14:28:00 -08:00
Adrian Sampson
5096653483
Simpler serialization
...
Just use a dictionary instead of a list of tiny one-key dictionaries. Still
need to update the deserialization.
2015-11-14 14:23:57 -08:00
Adrian Sampson
9848b51008
Simplify field selection
2015-11-14 14:19:09 -08:00
Adrian Sampson
105cd73906
Start expunging opts carry-through
...
A dedicated command function takes care of the options and turns them into
normal variables.
2015-11-14 14:05:40 -08:00
Adrian Sampson
3c01c49a2c
Less chatty interface
...
Removed three prompts:
1. The "really edit?" prompt. If you don't want to edit, you can just not make
any changes.
2. The "done?" loop. This seems unnecessary; we'll confirm afterward anyway.
3. The YAML checker. This removal could indeed make things inconvenient, since
your changes get thrown away if you make a YAML mistake. For the moment,
simplicity is taking priority.
2015-11-14 13:53:25 -08:00
Adrian Sampson
ce31c2df23
Remove some dead code and hoist utility functions
2015-11-14 13:43:58 -08:00
Adrian Sampson
de6813eab5
Remove vestigial editor config option
...
We now just use $EDITOR.
2015-11-14 13:38:41 -08:00
Adrian Sampson
b33a024549
Simplify write logic
2015-11-14 13:37:17 -08:00
Adrian Sampson
b593d01100
Use qualified names for ui utilities
2015-11-14 13:33:02 -08:00
Adrian Sampson
2d8350ef03
Use standard machinery for opening editor
2015-11-14 13:31:42 -08:00
Adrian Sampson
e235cb7c42
Remove vestiges of diff_method option
2015-11-14 12:56:53 -08:00
Adrian Sampson
d7d609442e
Remove diff_method option
...
Our built-in "diff"-like functionality is pretty good because it's aware of
beets' data structures and types. This makes it more legible, in my opinion,
than an ordinary textual diff. So for now, I'm making this the only option (in
the spirit of making the plugin as straightforward as humanly possible).
2015-11-14 12:53:45 -08:00
Adrian Sampson
71e1547291
Remove some communication through fields
...
This is the first of many changes to reduce the use of `self.x` where plain
parameter passing can make things more clear.
2015-11-14 12:50:53 -08:00
jmwatte
5eca75321e
simplify by removing sum-option and renaming for clarity
2015-11-13 17:56:03 +01:00
jmwatte
024ab0159b
remove webbrowser for opening default editor/browser
2015-11-13 15:03:27 +01:00
jmwatte
386578d69c
change opts.extra to type choice
2015-11-13 11:24:19 +01:00
Diego Moreda
1c09eeb714
edit: delete temporary files, minor style fixes
...
* Delete NamedTemporaryFiles once they are not needed on several functions
(change_objs(), vimdiff(), html()).
* Fix use of reserved word "id" on same_format().
* Colorize "really modify" prompt with action_default.
2015-11-08 19:37:10 +01:00
Adrian Sampson
331ced3cca
Use existing query mechanism
2015-11-07 12:51:22 -08:00
Adrian Sampson
417eb5e588
Remove use of nonexistent option
2015-11-07 12:46:35 -08:00
Adrian Sampson
519df6da04
Use standard output format for confirmation
2015-11-07 12:45:39 -08:00
Adrian Sampson
7de33c83c4
Remove an unused parameter
2015-11-07 12:39:31 -08:00
Adrian Sampson
fefb2e9914
A little cleanup for legibility and style
2015-11-07 12:36:22 -08:00
jmwatte
f95611dde4
fixed albumid needs to be int
2015-11-05 16:51:33 +01:00
jmwatte
17a32e33c5
added grouping of fields and "$BROWSER" and "$EDITOR"
2015-11-05 15:41:33 +01:00
jmwatte
1f3a42faf0
Update edit.py
2015-11-03 14:57:07 +01:00
jmwatte
2d77861e4d
renamed and updated editplugin
2015-11-03 13:55:08 +01:00