From bd5c141a0f2e633f8ca214a2e5c9c13cada36b9d Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Mon, 16 Feb 2026 13:03:38 +0100 Subject: [PATCH] Fixed using IDs internally for paths --- .../GoogleWorkspace/SourceItems/CalendarSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/ChatSpaceSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/ChatSpaceTypeSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/ContactSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/DriveFileSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/DriveFolderSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/GmailLabelSourceEntry.cs | 2 +- proprietary/GoogleWorkspace/SourceItems/GroupSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/KeepNoteSourceEntry.cs | 2 +- .../GoogleWorkspace/SourceItems/MetaRootSourceEntry.cs | 6 +++--- .../GoogleWorkspace/SourceItems/SharedDriveSourceEntry.cs | 5 +++-- .../GoogleWorkspace/SourceItems/UserTypeSourceEntry.cs | 6 +++--- 12 files changed, 18 insertions(+), 17 deletions(-) diff --git a/proprietary/GoogleWorkspace/SourceItems/CalendarSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/CalendarSourceEntry.cs index d5c5e2ecb..1e9d9ce0a 100644 --- a/proprietary/GoogleWorkspace/SourceItems/CalendarSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/CalendarSourceEntry.cs @@ -10,7 +10,7 @@ using Google.Apis.Drive.v3; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class CalendarSourceEntry(string parentPath, string userId, CalendarListEntry calendar, CalendarService service, DriveService driveService, CalendarService? aclService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, calendar.SummaryOverride ?? calendar.Summary)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, calendar.Id)), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/ChatSpaceSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/ChatSpaceSourceEntry.cs index 4bcbfcaf7..6b8b28f11 100644 --- a/proprietary/GoogleWorkspace/SourceItems/ChatSpaceSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/ChatSpaceSourceEntry.cs @@ -10,7 +10,7 @@ using Google.Apis.Drive.v3; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class ChatSpaceSourceEntry(string parentPath, Space space, HangoutsChatService chatService, DriveService driveService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, (space.DisplayName ?? space.Name).Split('/').Last())), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, space.Name.Split('/').Last())), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/ChatSpaceTypeSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/ChatSpaceTypeSourceEntry.cs index 6b2959972..04e15bfb6 100644 --- a/proprietary/GoogleWorkspace/SourceItems/ChatSpaceTypeSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/ChatSpaceTypeSourceEntry.cs @@ -12,7 +12,7 @@ namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; /// Represents a folder containing all spaces of a specific type (SPACE, GROUP_CHAT, or DIRECT_MESSAGE). /// internal class ChatSpaceTypeSourceEntry(string parentPath, string spaceType, HangoutsChatService chatService, DriveService driveService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, GetDisplayName(spaceType))), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, spaceType)), null, null) { private static string GetDisplayName(string spaceType) => spaceType switch { diff --git a/proprietary/GoogleWorkspace/SourceItems/ContactSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/ContactSourceEntry.cs index 57710ed0c..2e19a532a 100644 --- a/proprietary/GoogleWorkspace/SourceItems/ContactSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/ContactSourceEntry.cs @@ -8,7 +8,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class ContactSourceEntry(string parentPath, Person person) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, person.ResourceName.Split('/').LastOrDefault() ?? person.ResourceName)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, person.ResourceName.Split('/').Last())), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/DriveFileSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/DriveFileSourceEntry.cs index f5f2d54be..6e3fb43ad 100644 --- a/proprietary/GoogleWorkspace/SourceItems/DriveFileSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/DriveFileSourceEntry.cs @@ -9,7 +9,7 @@ using File = Google.Apis.Drive.v3.Data.File; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class DriveFileSourceEntry(string parentPath, File file, DriveService driveService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, file.Name)), file.CreatedTimeDateTimeOffset.HasValue ? file.CreatedTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch, file.ModifiedTimeDateTimeOffset.HasValue ? file.ModifiedTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, file.Id)), file.CreatedTimeDateTimeOffset.HasValue ? file.CreatedTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch, file.ModifiedTimeDateTimeOffset.HasValue ? file.ModifiedTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/DriveFolderSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/DriveFolderSourceEntry.cs index afb5272fb..2851c4f92 100644 --- a/proprietary/GoogleWorkspace/SourceItems/DriveFolderSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/DriveFolderSourceEntry.cs @@ -8,7 +8,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class DriveFolderSourceEntry(string parentPath, string userId, string name, string folderId, DriveService driveService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, name)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, folderId)), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/GmailLabelSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/GmailLabelSourceEntry.cs index 9abd3d73b..8ca00915b 100644 --- a/proprietary/GoogleWorkspace/SourceItems/GmailLabelSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/GmailLabelSourceEntry.cs @@ -10,7 +10,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class GmailLabelSourceEntry(string userId, string parentPath, Label label, GmailService service) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, label.Name)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, label.Id)), null, null) { public override IAsyncEnumerable Enumerate(CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/GroupSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/GroupSourceEntry.cs index ae9c8f368..32821b6d6 100644 --- a/proprietary/GoogleWorkspace/SourceItems/GroupSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/GroupSourceEntry.cs @@ -8,7 +8,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class GroupSourceEntry(SourceProvider provider, string parentPath, Group group) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, group.Name ?? group.Email)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, group.Id)), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { diff --git a/proprietary/GoogleWorkspace/SourceItems/KeepNoteSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/KeepNoteSourceEntry.cs index c0757b4c7..bf9ad3c0a 100644 --- a/proprietary/GoogleWorkspace/SourceItems/KeepNoteSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/KeepNoteSourceEntry.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class KeepNoteSourceEntry(string parentPath, Note note, KeepService keepService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, note.Title ?? note.Name)), + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, note.Name.Split('/').Last())), note.CreateTimeDateTimeOffset.HasValue ? note.CreateTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch, note.UpdateTimeDateTimeOffset.HasValue ? note.UpdateTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch) { diff --git a/proprietary/GoogleWorkspace/SourceItems/MetaRootSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/MetaRootSourceEntry.cs index 74025528b..5a76e91be 100644 --- a/proprietary/GoogleWorkspace/SourceItems/MetaRootSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/MetaRootSourceEntry.cs @@ -7,7 +7,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class MetaRootSourceEntry(SourceProvider provider, string parentPath, string name, SourceItemType type) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, name)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, type.ToString())), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { @@ -136,8 +136,8 @@ internal class MetaRootSourceEntry(SourceProvider provider, string parentPath, s { { "gsuite:v", "1" }, { "gsuite:Type", type.ToString() }, - { "gsuite:Name", System.IO.Path.GetFileName(Path) }, - { "gsuite:Id", System.IO.Path.GetFileName(Path) } + { "gsuite:Name", name }, + { "gsuite:Id", type.ToString() } } .Where(kv => !string.IsNullOrEmpty(kv.Value)) .ToDictionary(kv => kv.Key, kv => kv.Value)); diff --git a/proprietary/GoogleWorkspace/SourceItems/SharedDriveSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/SharedDriveSourceEntry.cs index 6d397f90d..0dd877b20 100644 --- a/proprietary/GoogleWorkspace/SourceItems/SharedDriveSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/SharedDriveSourceEntry.cs @@ -9,7 +9,7 @@ using System.Runtime.CompilerServices; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class SharedDriveSourceEntry(string parentPath, string userId, Drive drive, DriveService driveService) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, drive.Name)), drive.CreatedTimeDateTimeOffset.HasValue ? drive.CreatedTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch, DateTime.UnixEpoch) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, drive.Id)), drive.CreatedTimeDateTimeOffset.HasValue ? drive.CreatedTimeDateTimeOffset.Value.UtcDateTime : DateTime.UnixEpoch, DateTime.UnixEpoch) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { @@ -29,7 +29,8 @@ internal class SharedDriveSourceEntry(string parentPath, string userId, Drive dr { "gsuite:v", "1" }, { "gsuite:Type", SourceItemType.SharedDrives.ToString() }, // Or specific type? { "gsuite:Name", drive.Name }, - { "gsuite:Id", drive.Id } + { "gsuite:Id", drive.Id }, + { "gsuite:Kind", drive.Kind } } .Where(kv => !string.IsNullOrEmpty(kv.Value)) .ToDictionary(kv => kv.Key, kv => kv.Value)); diff --git a/proprietary/GoogleWorkspace/SourceItems/UserTypeSourceEntry.cs b/proprietary/GoogleWorkspace/SourceItems/UserTypeSourceEntry.cs index 63313e508..36f21d8d9 100644 --- a/proprietary/GoogleWorkspace/SourceItems/UserTypeSourceEntry.cs +++ b/proprietary/GoogleWorkspace/SourceItems/UserTypeSourceEntry.cs @@ -7,7 +7,7 @@ using Duplicati.Library.Interface; namespace Duplicati.Proprietary.GoogleWorkspace.SourceItems; internal class UserTypeSourceEntry(SourceProvider provider, string parentPath, string userId, string name, SourceItemType type) - : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, name)), null, null) + : MetaEntryBase(Util.AppendDirSeparator(SystemIO.IO_OS.PathCombine(parentPath, type.ToString())), null, null) { public override async IAsyncEnumerable Enumerate([EnumeratorCancellation] CancellationToken cancellationToken) { @@ -179,8 +179,8 @@ internal class UserTypeSourceEntry(SourceProvider provider, string parentPath, s { { "gsuite:v", "1" }, { "gsuite:Type", type.ToString() }, - { "gsuite:Name", System.IO.Path.GetFileName(Path) }, - { "gsuite:Id", System.IO.Path.GetFileName(Path) } + { "gsuite:Name", name }, + { "gsuite:Id", type.ToString() } } .Where(kv => !string.IsNullOrEmpty(kv.Value)) .ToDictionary(kv => kv.Key, kv => kv.Value));