Skip to main content

remove two unused files; keep tweaking

ID
bc23c7a
date
2023-05-13 21:36:06+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
d8dcb11
message
remove two unused files; keep tweaking
changed files
3 files, 4 additions, 133 deletions

Changed files

scripts/needs_action.swift (1687) → scripts/needs_action.swift (0)

diff --git a/scripts/needs_action.swift b/scripts/needs_action.swift
deleted file mode 100644
index 581543a..0000000
--- a/scripts/needs_action.swift
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env swift
-
-import Photos
-
-func getAlbumWith(name: String) -> PHAssetCollection {
-  let collections =
-    PHAssetCollection
-    .fetchAssetCollections(with: .album, subtype: .albumRegular, options: nil)
-
-  var thisAssetCollection: PHAssetCollection? = nil
-
-  collections.enumerateObjects({ (album, index, stop) in
-    let assetCollection = album
-
-    if assetCollection.localizedTitle == Optional(name) {
-      thisAssetCollection = assetCollection
-    }
-  })
-
-  if thisAssetCollection != nil {
-    return thisAssetCollection!
-  } else {
-    fputs("Unable to find album with name: \(name).\n", stderr)
-    exit(1)
-  }
-}
-
-func getPhotoWith(uuid: String) -> PHAsset {
-  let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: [uuid], options: nil)
-
-  if fetchResult.count == 1 {
-    return fetchResult.firstObject!
-  } else {
-    fputs("Unable to find photo with ID: \(uuid).\n", stderr)
-    exit(1)
-  }
-}
-
-let arguments = CommandLine.arguments
-
-guard arguments.count == 2 else {
-  fputs("Usage: \(arguments[0]) PHOTO_ID\n", stderr)
-  exit(1)
-}
-
-let flagged = getAlbumWith(name: "Flagged")
-let rejected = getAlbumWith(name: "Rejected")
-let needsAction = getAlbumWith(name: "Needs Action")
-
-let photo = getPhotoWith(uuid: arguments[1])
-
-try PHPhotoLibrary.shared().performChangesAndWait {
-  let changeFlagged =
-    PHAssetCollectionChangeRequest(for: flagged)!
-  let changeRejected =
-    PHAssetCollectionChangeRequest(for: rejected)!
-  let changeNeedsAction =
-    PHAssetCollectionChangeRequest(for: needsAction)!
-
-  let assets = [photo] as NSFastEnumeration
-
-  changeFlagged.removeAssets(assets)
-  changeRejected.removeAssets(assets)
-  changeNeedsAction.addAssets(assets)
-}

scripts/reject.swift (1687) → scripts/reject.swift (0)

diff --git a/scripts/reject.swift b/scripts/reject.swift
deleted file mode 100644
index 68aea71..0000000
--- a/scripts/reject.swift
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env swift
-
-import Photos
-
-func getAlbumWith(name: String) -> PHAssetCollection {
-  let collections =
-    PHAssetCollection
-    .fetchAssetCollections(with: .album, subtype: .albumRegular, options: nil)
-
-  var thisAssetCollection: PHAssetCollection? = nil
-
-  collections.enumerateObjects({ (album, index, stop) in
-    let assetCollection = album
-
-    if assetCollection.localizedTitle == Optional(name) {
-      thisAssetCollection = assetCollection
-    }
-  })
-
-  if thisAssetCollection != nil {
-    return thisAssetCollection!
-  } else {
-    fputs("Unable to find album with name: \(name).\n", stderr)
-    exit(1)
-  }
-}
-
-func getPhotoWith(uuid: String) -> PHAsset {
-  let fetchResult = PHAsset.fetchAssets(withLocalIdentifiers: [uuid], options: nil)
-
-  if fetchResult.count == 1 {
-    return fetchResult.firstObject!
-  } else {
-    fputs("Unable to find photo with ID: \(uuid).\n", stderr)
-    exit(1)
-  }
-}
-
-let arguments = CommandLine.arguments
-
-guard arguments.count == 2 else {
-  fputs("Usage: \(arguments[0]) PHOTO_ID\n", stderr)
-  exit(1)
-}
-
-let flagged = getAlbumWith(name: "Flagged")
-let rejected = getAlbumWith(name: "Rejected")
-let needsAction = getAlbumWith(name: "Needs Action")
-
-let photo = getPhotoWith(uuid: arguments[1])
-
-try PHPhotoLibrary.shared().performChangesAndWait {
-  let changeFlagged =
-    PHAssetCollectionChangeRequest(for: flagged)!
-  let changeRejected =
-    PHAssetCollectionChangeRequest(for: rejected)!
-  let changeNeedsAction =
-    PHAssetCollectionChangeRequest(for: needsAction)!
-
-  let assets = [photo] as NSFastEnumeration
-
-  changeFlagged.removeAssets(assets)
-  changeRejected.addAssets(assets)
-  changeNeedsAction.removeAssets(assets)
-}

static/style.css (3027) → static/style.css (3058)

diff --git a/static/style.css b/static/style.css
index d38000a..4cd780f 100644
--- a/static/style.css
+++ b/static/style.css
@@ -40,6 +40,7 @@ a {
   padding-top: 1px;
   font-size: 13px;
   line-height: 16px;
+  border-top-left-radius: 6px;
   border-bottom-right-radius: 18px;
   margin-left: -3px;
   margin-top: -3px;
@@ -48,7 +49,7 @@ a {
 }
 
 #thumbnails div.this_asset div.thumbnail .state {
-  width: 19px;
+  width: 18px;
   height: 21px;
   color: white;
   text-align: left;
@@ -57,8 +58,8 @@ a {
   font-size: 17px;
   line-height: 16px;
   border-bottom-right-radius: 18px;
-  margin-left: -3px;
-  margin-top: -3px;
+  margin-left: -2px;
+  margin-top: -1px;
   font-family: serif;
 }