Skip to content

Commit

Permalink
Merge branch 'main' into feature/metadata-for-all
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/pr-build.yaml
  • Loading branch information
bc3tech committed Jul 19, 2024
2 parents 747244f + 0f231e2 commit 8381ca6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ jobs:
with:
name: binaries
path: pub/FileSorter.*
choco-pack:
needs: build-release
if: steps.isCodeOwner.outputs.isCodeOwner == 'true'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: binaries
path: bin

- name: Package
run: cd choco && choco pack --version ${{ env.APP_VERSION }}

- name: Upload nupkg
uses: actions/upload-artifact@v4
with:
name: nupkg
path: choco/*.nupkg
build-debug:
runs-on: windows-latest
steps:
Expand Down
7 changes: 4 additions & 3 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using System.Linq;
using System.Threading.Tasks;

using ExifLib;
using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack.Shell.PropertySystem;

using PowerArgs;

Expand Down Expand Up @@ -185,7 +186,7 @@ DateTime determineTimeToUse(out DateTime fileTime, out DateTime embeddedTime)

static DateTime getEmbeddedTimestamp(string fileName)
{
var ps = Microsoft.WindowsAPICodePack.Shell.ShellFile.FromFilePath(fileName);
var ps = ShellFile.FromFilePath(fileName);
return ps.Properties.System.Photo.DateTaken.Value ?? ps.Properties.System.Media.DateEncoded.Value ?? DateTime.MinValue;
}

Expand All @@ -209,7 +210,7 @@ void setTimestamp()

if (getEmbeddedTimestamp(fi.FullName) != timeToUse)
{
var ps = Microsoft.WindowsAPICodePack.Shell.ShellFile.FromFilePath(fi.FullName);
var ps = ShellFile.FromFilePath(fi.FullName);
Console.WriteLine($@"Updating embedded time on {fi.FullName} -> {timeToUse} ...");
if (!input.NoOp)
{
Expand Down

0 comments on commit 8381ca6

Please sign in to comment.