       @add(summary: {type: 'text', '': abstr}) if abstr && abstr.length != 0
 
       for attachment in attachments
-        Zotero.OPDS.log("attachment #{attachment.getFilename()} has type #{attachment.attachmentMIMEType} / #{Zotero.OPDS.MIMEService.getTypeFromExtension(attachment.getFilename().replace(/.*\./, ''))}")
+        Zotero.OPDS.log("attachment #{attachment.getFilename()} has type #{Zotero.OPDS.contentType(attachment)}")
 
         @add(link: {
-          type: attachment.attachmentMIMEType || 'application/pdf'
+          type: Zotero.OPDS.contentType(attachment)
           rel: 'http://opds-spec.org/acquisition'
           href: "/opds/item?library=#{attachment.libraryID || 0}&key=#{attachment.key}"
           })


    Zotero.debug("[opds] #{msg.join(' ')}")
    return

  url: ->
    try

      attachments = item.getAttachments() or []
      attachments = Zotero.Items.get(attachments) if attachments.length != 0
    Zotero.OPDS.log("'#{item.getDisplayTitle(true)}' has #{attachments.length} attachments")
    attachments = (a for a in attachments when a.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL && a.attachmentMIMEType? != "text/html" && Zotero.OPDS.contentType(a))
    Zotero.OPDS.log("'#{item.getDisplayTitle(true)}' has #{attachments.length} supported attachments")

    return if attachments.length == 0
