Releases: CosmicHorrorDev/subwinder
v1.1.2 Bugfix (and other small changes)
Bugfixes
- (174bc95)
xml.parsers.expat.ExpatError
s from the API are now re-exposed asSubServerError
s to give more appropriate context. - (4a38a8c) Fixed a bug where
.download_subtitles(...)
was updated to takeSubtitlesInfo
along withSearchResult
: however, the helper function._download_subtitles(...)
was not fully updated to accept these changes appropriately. - (e3c1059) Fixed a bug where
filename
anddirname
weren't renamed from fakedMedia
in.download_subtitles(...)
leading to an error when trying to download withSubtitlesInfo
. This was updated to avoid fakingMedia
in general since it seems to be an error-prone solution. The test was updated to better cover the different cases.
Docs
- (23f03a2) Added another example to show off some more functionality provided by the library (namely
.suggest_media(...)
,.preview_subtitles(...)
,.user_info()
, and actually using some custom extendedMovieInfo
andTvSeriesInfo
- Some outdated information in the docs was found and updated
Dev tools
- (f079f70) Added in a tool that can generate files with a specified size and
special_hash
. This allows people to test functionality requiring local files without actually having them in cases where it would be cumbersome to build theMedia.from_parts
.
v1.1.1 Bugfix
- (2dd147a) Fixed a bug introduced from incorrectly checking the length of the pairs for
asw.search_subtitles(...)
and updated tests to prevent any regressions.
v1.1.0 Minor Release
Breaking Changes
- (#37) All the
.from_data(...)
constructors now just take the raw data instead offilename
anddirname
too - (#36) The ranking functions now take library objects instead of the raw data, so
rank_search_subtitles
now takes a list ofSearchResults
andrank_guess_media
takes the newGuessMediaResult
- (#47)
Media
andMediaInfo
'sfilename
anddirname
are both private now. They now include getters and setters if you want to take a look at the docs. This was done because they're assumed to bepathlib.Path
s, but the user may want to pass in any pathlike value - (#42)
.report_move(...)
was renamed to.report_media(...)
to match the media agnostic tone of the rest of the library
New Features
- (#40)
ranking
module was made public since the different ranking functions make good fallbacks for custom ranking functions - (#41) Several endpoints dealing with subtitles related actions can now take
SubtitlesInfo
objects along withSearchResult
s - (#43)
report_media
now raises aValueError
when it's used with aSearchResult
that wasn't found using the filehash and size - (#34)
search_subtitles
andguess_media
now have unranked variants that directly return a list ofSearchResult
s andGuessMediaResult
s for each query respectively - (#45)
.search_subtitles(...)
can now take queries as azip
too which works well for giving the desired language codes - (2f9ffde)
atomicwrites
is now included as an optional dependency to allow for saving subtitles atomically - (2d670be) the library now aggressively checks for wrong types and tries to return information on the allowed types
Bugfixes
- (#46)
.guess_media(...)
previously had some weird edge-cases that would throw an obscure error (searching for""
, or something with no results like"asdkfjldsflgskdmfkl"
). Now the library handles these cases and the ranked version returnsNone
while the unranked variant getsGuessMediaResult
with no data (full ofNone
and emptylist
s)
Documentation
- (#39) More advanced examples were added to show a more featureful quickstart and more robust searching
Misc.
Minor Bugfix Release
Bugfixes
- Fixed a bug where the
lang
module still tried passing in a string for the endpoint instead of asubwinder._request.Endpoints
option. This would cause fetching the lang list to fail which means most of the endpoints would fail to work correctly.
Minor Bugfix Release
Bugfixes
AuthSubwinder
bugs- Fixed a bug where having
download_dir
set in.download_subtitles(...)
will fail with a type error due to incorrect changes trying to usepathlib.Path
s - Fixed a bug where you incorrectly couldn't
.vote(...)
for subtitles with ascore
of 1
- Fixed a bug where having
All bugs have had tests added/updated to ensure behavior doesn't regress.
1.0 Release!
The fabled 1.0 release. No this isn't close to the final version of the library, I'm saving 2.0 for having all the endpoints exposed that I'm planning on exposing (#8). Instead this is more to signify that the library's API should be mostly stable and I wanted the chance to make some breaking changes early on if I could. So here goes
Features
- The docs are now tracked in the repo instead of using the GitHub wiki. This provides the ease of setup from not having to use some external site while allowing docs to be pinned to each version. If you want to read more about it you can check here (#23)
- Documentation was added for the
utils
functions - CI is now more extensive with unit testing run on all 3 major platforms (Windows, Mac, Linux). this has already helped to catch a platform-related bug before they made it into a release (4d7f1f5)
- On top of that more extensive tests are now run to catch bugs that popped up during the release
- Common classes are now exposed from the base module
from subwinder import AuthSubwinder, Subwinder, Media
- Media had its default construct switched to what was
.from_file(...)
, with the old constructor now residing as.from_parts(...)
- Downloaded subtitles are now saved atomically thanks to
atomicwrites
to prevent weird partially saved subtitles behavior
Bugfixes
name_format
fromAuthsubwinder
's.download_subtitles(...)
should now accept more formats as validProtocolError
s raised by opensubtitles API should be caught and handled now. It's hard to test with how sporadic the behavior is though
Breaking Changes
- Both the
subwinder.media.Subtitles
class and correspondingsubwinder.hashers.md5_hash
function were removed since they are considered dead code till uploading subtitles has been worked on Media
s constructor was changed to match the behavior of the old.from_file(...)
classmethod and the old constructor was added as the.from_parts(...)
classmethod- The whole library always uses
pathlib.Path
s for any file paths or names. Externally everything can take astr
orPath
path, but it will always be stored and exposed as aPath
now instead of astr
- Lots of internal restructuring
- Modules that were already private, but denoted wrong are now correctly private (
_constants
,_ranking
,_request
) - Everything from the
base
andauth
modules got moved intocore
SearchResult
got moved intoinfo
since it better matches those classesspecial_hash
was moved intoutils
- Modules that were already private, but denoted wrong are now correctly private (
Future Work
So most of the current groundwork has been laid out for CI, so some more work to finish that up will be done. Past that it's just improving documentation, getting some users to try out the library, and implementing the rest of the desired endpoints.
v0.5.1
So this release is the beginning or proper versioning and stability for the library. I gave up on proper versioning while the API was experiencing a lot of churn, but now that it's settled down I'll be doing proper versioning and release notes from here on out! If you want to play around with the current version it's available to download from pypi 🎉
Currently, the library supports some of what I consider the most common functionality in a nice ergonomic way (this is primarily searching and downloading which are demonstrated in the Quickstart). There's plenty of other functionality if you want to take a look in the wiki along with an outline of what endpoints are covered and what is still being worked on in #8. The main focus for work in the meantime will be on trying to improve quality of life before moving on to adding more features including, but not limited to:
- Adding some integration tests to test overall behavior
- Ideally this will test at least some of the code snippets included in the documentation. The hard part will be mocking out all the different API requests which will be painful, to say the least
- Actually catch server errors correctly
- Difficult to debug with how sporadic and infrequent the errors are
- Cache the downloads for github actions runs since currently the majority of the time is spent downloading dependencies
- Have formatting for
black
automatically push the changes to pull requests to reduce friction for new contributors - Automatically handle pushing releases to pypi when a release tag is pushed