       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")
+    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

      @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(/.*\./, ''))}")

        @add(link: {
          type: attachment.attachmentMIMEType || 'application/pdf'
          rel: 'http://opds-spec.org/acquisition'
          href: "/opds/item?library=#{attachment.libraryID || 0}&key=#{attachment.key}"
          })


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

  contentType: (attachment) ->
    return attachment.attachmentMIMEType if attachment.attachmentMIMEType && attachment.attachmentMIMEType != 'application/octet-stream'
    ext = attachment.getFilename().replace(/.*\./, '').toLowerCase()
    return switch ext
      when 'epub' then 'application/epub+zip'
      when 'pdf' then 'application/pdf'
      else null

  url: ->
    try
