Commit Graph

346 Commits

Author SHA1 Message Date
auouymous 375a94a139 Fix typos found by codespell. 2023-07-19 02:30:44 -06:00
luzpaz 8a995cb097 Fix various typos
Found via `codespell -q 3 -S *.po -L bloc,extracter,parms`
2023-07-14 12:13:50 +00:00
auouymous bda12a53c1 Allow IdleTimeout to scale based on how long the callback took.
upload_downloads_list() is now called at upto 5 second intervals when
there are a lot of tasks. Previously, it could take 5 seconds to run and
then only sleep for 1.5 seconds, making the UI unresponsive for long
periods.
2023-01-03 15:33:31 -07:00
auouymous e1fc290ef2 Remove all timer deadlocks by using idle_add priority for them.
Add util.idle_timeout_add() to register timers with the same priority as
idle_add(). Change the IdleTimeout to also use the idle_add() priority.
This eliminates the chance of a timer blocking any idle_add from
running.

Change most timeout_add's to idle_timeout_add. Change the timer in
DownloadStatusModel::get_next() back to an idle_add.
2023-01-03 06:01:15 -07:00
Teemu Ikonen d87ac85506 Fix 'W504 line break after binary operator' flake8 warnings
Fixed by running

autopep8 -i -r --select=W504 .

and some hand tuning.
2022-11-14 18:32:09 +02:00
Teemu Ikonen 6bd0bb0530 Remove unused imports and pass statements
Fixes flake8 error F401.
Most errors were fixed by running

autoflake -i -r --remove-all-unused-imports .

which also removes unnecessary 'pass' statements, some by hand-editing.
2022-11-14 18:32:09 +02:00
auouymous 1b9ed37064
Merge pull request #1382 from tpikonen/ytdl-rename
Fix yt-dlp output file name
2022-11-14 04:08:49 +00:00
auouymous 2659333380 Fix the format_time() function to display times greater than 24 hours.
Using datetime converts the seconds value into date and time components.
A value of 86400 generates a 00:00 time on the 2nd of January 1970.

The new code properly increments the hour field to 24 and beyond instead
of wrapping around to zero.
2022-09-17 19:29:24 -06:00
Teemu Ikonen ce02cf6810 util.sanitize_filename_ext: Return an empty ext, if sanitized_ext is empty
Prevents file names with two periods before the extension.
2022-09-03 15:09:57 +03:00
auouymous 60b3ba6093 Unwrap argument list when calling IdleTimeout function.
This prevented update_downloads_list() from cleaning up the download
list when finished, due to can_call_cleanup being set to ().
2022-08-27 04:50:48 -06:00
auouymous 165a45ac0d Add util.IdleTimeout class to reduce lag when updating progress tab. 2022-08-13 01:55:05 -06:00
auouymous f05ce1fc0a Switch deprecated GObject functions to GLib. 2022-08-13 00:33:28 -06:00
Teemu Ikonen 6af0035caf util.open_website: Return True to block 'activate-link' default handler 2022-07-05 14:48:26 +03:00
auouymous 41c312dd68 Change deprecated logger.warn() to logger.warning(). 2022-04-29 02:54:32 -06:00
lexolexo 778f5b708c
Added logic to trim away leading/trailing whitespaces in user-clipboard auto-inputted urls (#1276)
* Added logic to trim away leading/trailing whitespaces in user-inputted
urls. Tested against current gpodder-installe executable for correct/
desired behaviour. simplified receive_clipboard_text method of class
gPodderAddPodcast in addpodcast.py
resolves #520
2022-04-16 22:11:10 -07:00
auouymous 41b8f52fbf mount_volume_for_file() must only use Gtk when the Gtk UI is available.
Fixes #1212.
2022-01-25 14:32:04 -07:00
Benedikt Wildenhain 34098c19fc
Open error dialog if user tries to use not-installed program
Currently trying to use default player (xdg-)open when it's not installed
will only cause messages on the console, which might not be visible to
the user. This PR creates an alert box in this case.

Fixes #1003.
2022-01-16 18:24:41 +01:00
Eric Le Lay 40fd34b14a
Merge pull request #1206 from auouymous/fix-1195
Fix shownotes for episodes that contain HTML comments.
2022-01-03 09:32:33 +01:00
auouymous 3938809dd5 Fix shownotes for episodes that contain HTML comments.
When html5lib is used, a function is returned for each comment in the
HTML. It should be safe to skip functions until something else is found
to use them that causes issues finding hyperlinks.

Fixes #1195.
2022-01-01 18:15:51 -07:00
Eric Le Lay b8065cadf7 fix 1190 ERROR: Could not create save_dir on windows
"C:\gpodder-xxx\config\Downloads" results in
scheme="c" and path="\gpodder-xxx\config\Downloads"
(not double backslash)
2021-11-28 22:02:12 +01:00
Eric Le Lay 00b421b929 fix #1190 ERROR: Could not create save_dir on windows with gio
util.new_gio_file returned a GDummyFile, where every operation failed,
in this case make_directory_with_parents.
2021-11-01 16:36:57 +01:00
auouymous 114f708c74 Move scale_pixbuf to util.py and apply #1107 refactoring. 2021-08-14 23:42:17 -06:00
Eric Le Lay 71f8ee70b3
Merge pull request #1110 from gpodder/fix-missing-audio_webm
Fix missing extension when downloading youtube-dl format=worstaudio (audio/webm mimetype)
2021-08-11 18:20:42 +02:00
Teemu Ikonen 5bbc920a01 Support PEP 440 local version label
Handle public and local version parts of __version__ in version
comparisons and when parsing __version_info__.
2021-08-06 19:54:24 +03:00
auouymous 91b73ca40e Import gi only in function that need it. 2021-07-31 08:05:51 -06:00
auouymous 776b9b850e Fix additional linting issues. 2021-07-29 18:10:26 -06:00
Eric Le Lay efcdb905e8 fix last linting errors 2021-07-29 21:52:51 +02:00
auouymous 106e2f4fcd Fix linting issues from #1054 2021-07-27 21:44:04 -06:00
Eric Le Lay 5e857fd52a Fix missing extension when downloading youtube-dl format=worstaudio
See #1099 for a repro feed
2021-07-27 19:07:26 +02:00
Eric Le Lay 8f9159ebc7
Merge pull request #1098 from auouymous/make-text-shownotes-title-clickable
Make the text shownotes title a clickable and copyable link.
2021-07-26 21:13:55 +02:00
Eric Le Lay 04d0ea26d7
Merge pull request #1094 from auouymous/create-html-description-when-empty
Create an html description when none provided.
2021-07-23 15:06:53 +02:00
auouymous 0578ba503e Make the text shownotes title a clickable and copyable link. 2021-07-17 20:38:10 -06:00
auouymous b0ebfd5333 Create an html description when none provided.
The youtube-dl extension code is moved into gPodder to provide this
feature for all feeds lacking an html description. This enables
clickable links inside non-html descriptions. And if available, an image
tag for the episode art URL is prepended to the html description
(currently only available in html shownotes).
2021-07-16 21:03:38 -06:00
blushingpenguin e09f5aecad fix playlist sync 2021-07-11 19:52:34 +01:00
blushingpenguin e2a512a34c add mount call for CLI; fix done_callback not being called if opening device fails; handle errors from querying device 2021-06-12 15:45:53 +01:00
Teemu Ikonen d1683d2203 util.format_filesize(): Use non-breaking space between value and unit 2021-05-09 22:02:49 +03:00
auouymous 5d1363babc Fix regex to handle missing broadcast address.
Fixes #1014.
2021-04-22 16:32:31 -06:00
Teemu Ikonen a33d62058a util.linux_get_active_interfaces(): Use 'ip addr' instead of 'ip link' 2021-03-10 14:47:22 +02:00
Teemu Ikonen a60183e49c util.connection_available(): Prefer 'ip' to 'ifconfig'
Closes #974.
2021-03-09 21:48:52 +02:00
Teemu Ikonen 0e94386bd3 Use raw strings in regexp patterns, fix DeprecationWarnings 2021-01-15 13:48:21 +02:00
Eric Le Lay 463e460170 Merge remote-tracking branch 'origin/master' into requests 2020-09-11 17:07:03 +02:00
Eric Le Lay 0d0e7f6108 retry 3 times for feedcore and other util.urlopen usage
main goal is for feedcore but I don't see how it would
hurt to retry in other (cover download, etc.) cases.
2020-09-07 11:25:13 +02:00
Youve 3fce988eb7 DORMANT is a power-saving mode of being online. Without this change, gPodder thinks I'm offline when I am really online. 2020-08-07 00:40:02 +02:00
Eric Le Lay 12912bed3e fix naive access to response.text
bytes for xml, utf-8 fallback for html, known encoding if available
2020-07-18 15:04:04 +02:00
Eric Le Lay d88a9097b5 set requests timeout 2020-07-12 17:06:34 +02:00
Eric Le Lay d40bc49e0e move download's get_header_param() to util, to use in soundcloud plugin 2020-07-12 17:06:34 +02:00
Eric Le Lay 3babb86c70 use requests package for util.urlopen
now a requests.Response is returned instead of the file-like object from urllib.
Fixed all usages of util.urlopen: it simplifies getting json, text encoding detection.
In particular feedcore (responsible for fetching feeds) is simplified.

This is a first pass and could benefit from better usage of the requests api
(Sessions for instance, to keep connection pools)

TODO: download.py
2020-07-11 17:42:28 +02:00
Eric Le Lay 9fd26f2f96 remove python2 import check 2020-07-10 16:49:14 +02:00
Eric Le Lay 9721620cec textual shownotes: skip <style> contents 2020-03-22 19:51:46 +01:00
Eric Le Lay a62fd58a79 use == for comparison with literal
See https://bugs.python.org/issue34850
2020-03-22 16:16:13 +01:00