mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Revert "Pass the new ID URL patterns to devices while maintaining compatibility with the old interface."
This reverts commit ee942b95061d709f544f74dc1e2fc08127f72d15.
This commit is contained in:
parent
ee942b9506
commit
90e6218e5a
@ -597,7 +597,6 @@ class DevicePlugin(Plugin):
|
|||||||
'''
|
'''
|
||||||
device_prefs.set_overrides()
|
device_prefs.set_overrides()
|
||||||
|
|
||||||
# A driver should implement at most one of the set_library_info methods
|
|
||||||
def set_library_info(self, library_name, library_uuid, field_metadata):
|
def set_library_info(self, library_name, library_uuid, field_metadata):
|
||||||
'''
|
'''
|
||||||
Implement this method if you want information about the current calibre
|
Implement this method if you want information about the current calibre
|
||||||
@ -606,15 +605,6 @@ class DevicePlugin(Plugin):
|
|||||||
'''
|
'''
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def set_library_info_extended(self, library_name, library_uuid, field_metadata, other_info):
|
|
||||||
'''
|
|
||||||
Implement this method if you want information about the current calibre
|
|
||||||
library. This method is called at startup and when the calibre library
|
|
||||||
changes while connected. The fourth parameter of this method is a dict
|
|
||||||
of other information, currently containing only the identifier patterns
|
|
||||||
'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Dynamic control interface.
|
# Dynamic control interface.
|
||||||
# The following methods are probably called on the GUI thread. Any driver
|
# The following methods are probably called on the GUI thread. Any driver
|
||||||
# that implements these methods must take pains to be thread safe, because
|
# that implements these methods must take pains to be thread safe, because
|
||||||
|
@ -1563,14 +1563,13 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
|||||||
self.plugboard_func = pb_func
|
self.plugboard_func = pb_func
|
||||||
|
|
||||||
@synchronous('sync_lock')
|
@synchronous('sync_lock')
|
||||||
def set_library_info_extended(self, library_name, library_uuid, field_metadata, other_info):
|
def set_library_info(self, library_name, library_uuid, field_metadata):
|
||||||
self._debug(library_name, library_uuid)
|
self._debug(library_name, library_uuid)
|
||||||
if self.can_accept_library_info:
|
if self.can_accept_library_info:
|
||||||
self._call_client('SET_LIBRARY_INFO',
|
self._call_client('SET_LIBRARY_INFO',
|
||||||
{'libraryName' : library_name,
|
{'libraryName' : library_name,
|
||||||
'libraryUuid': library_uuid,
|
'libraryUuid': library_uuid,
|
||||||
'fieldMetadata': field_metadata.all_metadata(),
|
'fieldMetadata': field_metadata.all_metadata()},
|
||||||
'otherInfo': other_info},
|
|
||||||
print_debug_info=True)
|
print_debug_info=True)
|
||||||
|
|
||||||
@synchronous('sync_lock')
|
@synchronous('sync_lock')
|
||||||
|
@ -477,15 +477,8 @@ class DeviceManager(Thread): # {{{
|
|||||||
|
|
||||||
def _set_library_information(self, library_name, library_uuid, field_metadata):
|
def _set_library_information(self, library_name, library_uuid, field_metadata):
|
||||||
'''Give the device the current library information'''
|
'''Give the device the current library information'''
|
||||||
# Try both the new and the old API. This helps with device drivers that
|
|
||||||
# are user-installed plugins built around the old Interface class
|
|
||||||
self.device.set_library_info(library_name, library_uuid, field_metadata)
|
self.device.set_library_info(library_name, library_uuid, field_metadata)
|
||||||
|
|
||||||
other_info = {}
|
|
||||||
from calibre.ebooks.metadata.sources.prefs import msprefs
|
|
||||||
other_info['id_link_rules'] = msprefs.get('id_link_rules', {})
|
|
||||||
self.device.set_library_info_extended(library_name, library_uuid, field_metadata, other_info)
|
|
||||||
|
|
||||||
def set_library_information(self, done, library_name, library_uuid,
|
def set_library_information(self, done, library_name, library_uuid,
|
||||||
field_metadata, add_as_step_to_job=None):
|
field_metadata, add_as_step_to_job=None):
|
||||||
'''Give the device the current library information'''
|
'''Give the device the current library information'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user