Commit graph

7825 commits

Author SHA1 Message Date
Antoine Beaupré
a8afabea80
move slug utility function to top-level
it's a generic utility function that can be reused, there's nothing
class-specific about it.
2017-07-18 16:12:48 -04:00
Antoine Beaupré
458f3636f4
compare artists based on the slug
this is necessary because otherwise artists with different string
representations but the same slug would overwrite one another

this outlines more clearly the code duplication between the rst code
and the slugify function, something which can be fixed later.
2017-07-17 11:59:14 -04:00
Antoine Beaupré
9c36a41ea8
slight refactoring: strip album only once 2017-07-17 11:50:15 -04:00
Antoine Beaupré
9894e8752b
ignore trailing/leading whitespace when comparing artists 2017-07-17 11:49:35 -04:00
Antoine Beaupré
36f84bfedd
add missing trailing newline after lyrics block
this would yield a warning for every song
2017-07-17 11:44:06 -04:00
Adrian Sampson
b303d5beb0 Slightly more complete sentences in comments 2017-07-17 10:59:04 -04:00
Adrian Sampson
aefb1c4947 Merge pull request #2628 from anarcat/lyrics-html
print lyrics as HTML
2017-07-17 10:56:29 -04:00
Antoine Beaupré
93966ed4ee
strip whitespace in titles
this would cause problems with songs that had trailing spaces with the
index directive
2017-07-17 09:00:22 -04:00
Antoine Beaupré
b6e42ee2e8
fix another unicode error
the unicode strings are not binary - rely on Python to do the right
thing here instead of encoding a string we know is already properly
encoded
2017-07-17 08:55:09 -04:00
Antoine Beaupré
6d58110bd2
move heredocs to top-level globals 2017-07-17 08:50:19 -04:00
Antoine Beaupré
7e0a48a46d
s/rest/rest/ 2017-07-17 08:49:40 -04:00
Adrian Sampson
cf75b1548e Changelog entry for #2628 2017-07-16 10:15:45 -04:00
Adrian Sampson
9de94378b9 An even shorter metavariable 2017-07-16 10:14:49 -04:00
Adrian Sampson
813cf97686 Better metavariable for lyrics --help output 2017-07-16 10:10:41 -04:00
Adrian Sampson
d44eda56c5 Docs refinements for lyrics ReST output 2017-07-16 10:07:32 -04:00
Adrian Sampson
c655a13c41 Use title case in docs 2017-07-16 10:02:14 -04:00
Antoine Beaupré
5d8c15980e
fix flake8 warning 2017-07-15 16:24:07 -04:00
Antoine Beaupré
0bcd16f1ab
deal with encoding issues in python3
when we encode explicitly, we return bytes, so open files as binary
2017-07-15 16:21:41 -04:00
Antoine Beaupré
f667428758
write sphinx base files
we write the artists files in a subdirectory, to avoid infinite
recursions or flooding the current directory needlessly.

this way, the user has a good base structure and can just chain the
command into sphinx to continue building the next format, after
possible tweaks.
2017-07-15 15:43:16 -04:00
Antoine Beaupré
e6adb5e7da
cosmetic: do not use needless heredoc 2017-07-15 15:33:35 -04:00
Antoine Beaupré
91de8aac84
move rst writer to a different function
this simplifies and clarifies the code, although we need to call the writerst function twice to wrap up at the end of the loop
2017-07-15 15:33:35 -04:00
Antoine Beaupré
d330353e1c
rename the skip option to local
skip was a misnomer: we actually skip "unfetched" lyrics. this means
it's somewhat of a double-negative and really confusing.

--local is clearer, although less in opposition with --force
2017-07-15 14:19:25 -04:00
Antoine Beaupré
32de4148bc
use glob patterns correctly in index 2017-07-15 09:30:14 -04:00
Antoine Beaupré
ac32ae574c
optimize: write only 3 times per file
this makes the code more readable and reduces the number of syscalls
to write files
2017-07-15 09:23:59 -04:00
Antoine Beaupré
469c03a7bf
deal properly with empty album titles 2017-07-15 09:23:59 -04:00
Antoine Beaupré
63aa3b3165
write to separate rst files
this makes the ePUB easier to parse by e-readers, because they do not
need to load one giant HTML file, but one per author. it also makes
sphinx rendering more efficient and interactive
2017-07-15 09:23:58 -04:00
Antoine Beaupré
2fa46a7507
add documentation for new lyrics flags 2017-07-14 17:43:37 -04:00
Antoine Beaupré
0fbfa1feae
render RST instead of HTML
ReStructuredText has the advantage over HTML that it can be rendered
easily to multiple formats (HTML, ePUB, PDF) and it supports indexes.

the output needs to be fed into a file and integrated into an existing
Sphinx document, of course.
2017-07-14 17:34:55 -04:00
Antoine Beaupré
9f3e5b28b4
output lyrics in HTML, allow skipping
the idea here is to format the lyrics output a little better so that
it can (for example) be shown as a web page or an ebook.

the new skip option allows for faster generation of the output in the
(most common) case where not all lyrics are available.
2017-07-14 15:31:22 -04:00
Adrian Sampson
e742f8694c Changelog for #2623 (fixes #2615) 2017-07-06 23:20:40 -04:00
Adrian Sampson
774fa62969 Merge pull request #2623 from autrimpo/r128-#2615
fixes issue #2615 - wrong r128 tag being accessed
2017-07-06 23:19:42 -04:00
Michal Koutenský
70a2ad354b fixes issue #2615 2017-07-04 15:53:02 +02:00
Adrian Sampson
6185c6ad4b Changelog for #2605 2017-06-21 10:28:43 -04:00
Adrian Sampson
5ca43c3cc0 Merge pull request #2605 from beetbox/fixednone
Always use specific null values for fixed fields
2017-06-21 10:15:03 -04:00
Adrian Sampson
336fdba9ed Musical key field may be None
Fixes a `modify` test, of all things.
2017-06-20 16:31:00 -04:00
Adrian Sampson
8085d1318b Fix ipfs test to sort items in order 2017-06-20 16:19:31 -04:00
Adrian Sampson
41bd6f9a97 Explicitly let artpath be missing
We really want `Album.artpath` to be None sometimes, and this was relying on
some accidental dbcore behavior before. Now, we explicitly mark the field as
nullable: it may be a path, or it may be None to indicate that there is no
art.
2017-06-20 16:04:25 -04:00
Adrian Sampson
2a9be17cf6 Fix some brittle query tests
These were written to incidentally depend on Nones; the behavior they're
actually testing doesn't really have anything to say about None-ness.
2017-06-20 15:56:33 -04:00
Adrian Sampson
b575a1ef75 Always use specific null values for fixed fields
This came out of an attempt to address the mysterious testing problems from
PR #2563 and turned into a big old debacle. As it turns out, the problem came
from calling Item.from_path and getting None for fields that weren't filled
out by the MediaFile data. Everywhere else, we fill out these fixed attributes
with the special null value for the field's type, so it's actually pretty
confusing that these could mysteriously become None. I think it will be saner
all around if we enforce this universally.

There were two possible fixes: one in __getitem__ to check for missing values
and one that set all the missing values in the constructor. I opted for the
former because it has a smaller footprint, but the latter might have slightly
better performance (depending on the ratio of constructions to lookups).
2017-06-20 15:50:37 -04:00
Adrian Sampson
7e8056b0e8 Version bump: 1.4.6 2017-06-20 14:49:19 -04:00
Adrian Sampson
4917bd30f7 Add date to changelog 2017-06-20 14:48:48 -04:00
Adrian Sampson
2cd3e13aa7 Spruce up changelog for release 2017-06-20 14:47:11 -04:00
Adrian Sampson
d2106454c4 Fix path in read errors while writing (#2599) 2017-06-17 12:43:25 -04:00
Adrian Sampson
732f0174c8 Expand error message for FileTypeError (#2599)
...when Mutagen doesn't recognize the type at all.
2017-06-17 12:42:00 -04:00
Adrian Sampson
d31a48345f Merge pull request #2598 from beetbox/relativedate
Relative date queries (continuation of #2418)
2017-06-16 11:48:56 -04:00
Adrian Sampson
a52d3d532a Changelog for relative dates (#2418, #2598) 2017-06-16 11:13:01 -04:00
Adrian Sampson
b1b4272501 Refinements to the relative date docs 2017-06-16 11:11:12 -04:00
Adrian Sampson
690ed731d8 Move the relative date docs downward
It's important to introduce the .. syntax before we get here.
2017-06-16 11:07:24 -04:00
euri10
eaae3fbd30 Merge branch 'relativedate' 2017-06-16 09:15:38 +02:00
euri10
93f064f505 Renamed relative to relative_units
Changed the return in case of a relative date, by default precision is
to the second, aka 5
Removed old 'relative' precision that indeed isn't necessary anymore
Corrected doc according to current relative date format, no more @
2017-06-16 09:14:40 +02:00