~ubuntu-branches/debian/sid/calibre/sid

« back to all changes in this revision

Viewing changes to src/calibre/db/cache.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-02-27 07:48:06 UTC
  • mto: This revision was merged to the branch mainline in revision 74.
  • Revision ID: package-import@ubuntu.com-20140227074806-64wdebb3ptosxhhx
Tags: upstream-1.25.0+dfsg
ImportĀ upstreamĀ versionĀ 1.25.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1254
1254
            if name and not replace:
1255
1255
                return False
1256
1256
 
1257
 
            path = self._field_for('path', book_id).replace('/', os.sep)
 
1257
            path = self._field_for('path', book_id)
 
1258
            if path is None:
 
1259
                # Theoretically, this should never happen, but apparently it
 
1260
                # does: http://www.mobileread.com/forums/showthread.php?t=233353
 
1261
                self._update_path({book_id}, mark_as_dirtied=False)
 
1262
                path = self._field_for('path', book_id)
 
1263
 
 
1264
            path = path.replace('/', os.sep)
1258
1265
            title = self._field_for('title', book_id, default_value=_('Unknown'))
1259
1266
            author = self._field_for('authors', book_id, default_value=(_('Unknown'),))[0]
1260
1267
            stream = stream_or_path if hasattr(stream_or_path, 'read') else lopen(stream_or_path, 'rb')
1634
1641
 
1635
1642
    @write_api
1636
1643
    def create_custom_column(self, label, name, datatype, is_multiple, editable=True, display={}):
1637
 
        self.backend.create_custom_column(label, name, datatype, is_multiple, editable=editable, display=display)
 
1644
        return self.backend.create_custom_column(label, name, datatype, is_multiple, editable=editable, display=display)
1638
1645
 
1639
1646
    @write_api
1640
1647
    def set_custom_column_metadata(self, num, name=None, label=None, is_editable=None,