Skip to content

Commit

Permalink
Added contentHash
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Filetti committed Dec 17, 2015
1 parent 73656e3 commit de9bc17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions JustUsed/DiMe Data/DocumentInformationElement.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class DocumentInformationElement: DiMeBase {
// attempt to fetch plain text from url
if let url = NSURL(string: histItem.url), urlData = NSData(contentsOfURL: url), atString = NSAttributedString(HTML: urlData, documentAttributes: nil) {
theDictionary["plainTextContent"] = atString.string
theDictionary["contentHash"] = atString.string.sha1()
}

// set dime-required fields
Expand Down Expand Up @@ -56,6 +57,7 @@ class DocumentInformationElement: DiMeBase {
let docUrl = NSURL(fileURLWithPath: histItem.path)
if let pdfDoc = PDFDocument(URL: docUrl), plainString = pdfDoc.getText() {
id = plainString.sha1()
theDictionary["contentHash"] = plainString.sha1()
theDictionary["plainTextContent"] = plainString
} else {
id = histItem.path.sha1()
Expand Down
4 changes: 2 additions & 2 deletions JustUsed/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3</string>
<string>2</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit de9bc17

Please sign in to comment.