mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add a tweak in Preferences->Tweaks to control where news that is automatically uploaded to a reader is sent. Fixes #9427 (Allow user to set default location for news delivery (main memory or storage card))
This commit is contained in:
parent
d0d627472f
commit
34569d6cf2
@ -355,3 +355,11 @@ draw_hidden_section_indicators = True
|
||||
# large covers
|
||||
maximum_cover_size = (1200, 1600)
|
||||
|
||||
#: Where to send downloaded news
|
||||
# When automatically sending downloaded news to a connected device, calibre
|
||||
# will by default send it to the main memory. By changing this tweak, you can
|
||||
# control where it is sent. Valid values are "main", "carda", "cardb". Note
|
||||
# that if there isn't enough free space available on the location you choose,
|
||||
# the files will be sent to the location with the most free space.
|
||||
send_news_to_device_location = "main"
|
||||
|
||||
|
@ -1052,11 +1052,13 @@ class DeviceMixin(object): # {{{
|
||||
except:
|
||||
pass
|
||||
total_size = self.location_manager.free[0]
|
||||
if self.location_manager.free[0] > total_size + (1024**2):
|
||||
loc = tweaks['send_news_to_device_location']
|
||||
loc_index = {"carda": 1, "cardb": 2}.get(loc, 0)
|
||||
if self.location_manager.free[loc_index] > total_size + (1024**2):
|
||||
# Send news to main memory if enough space available
|
||||
# as some devices like the Nook Color cannot handle
|
||||
# periodicals on SD cards properly
|
||||
on_card = None
|
||||
on_card = loc if loc in ('carda', 'cardb') else None
|
||||
self.upload_books(files, names, metadata,
|
||||
on_card=on_card,
|
||||
memory=[files, remove])
|
||||
|
Loading…
x
Reference in New Issue
Block a user