diff --git a/BookmarkSync.Core.Tests/Entities/BookmarkTests.cs b/BookmarkSync.Core.Tests/Entities/BookmarkTests.cs index c38f612..2848f16 100644 --- a/BookmarkSync.Core.Tests/Entities/BookmarkTests.cs +++ b/BookmarkSync.Core.Tests/Entities/BookmarkTests.cs @@ -6,17 +6,18 @@ namespace BookmarkSync.Core.Tests.Entities; public class BookmarkTests { [TestMethod] - public void App_HasProperties() + public void Bookmark_HasProperties() { // Arrange Bookmark obj = new(); // Assert - Assert.AreEqual(5, obj.PropertyCount()); + Assert.AreEqual(6, obj.PropertyCount()); Assert.IsTrue(obj.HasProperty("Account")); Assert.IsTrue(obj.HasProperty("Content")); Assert.IsTrue(obj.HasProperty("Id")); Assert.IsTrue(obj.HasProperty("Uri")); Assert.IsTrue(obj.HasProperty("Visibility")); + Assert.IsTrue(obj.HasProperty("DefaultTags")); } } diff --git a/BookmarkSync.Core/Entities/Bookmark.cs b/BookmarkSync.Core/Entities/Bookmark.cs index 65dc4e6..27560bc 100644 --- a/BookmarkSync.Core/Entities/Bookmark.cs +++ b/BookmarkSync.Core/Entities/Bookmark.cs @@ -14,4 +14,6 @@ public string? Content public string? Id { get; set; } public string? Uri { get; set; } public string? Visibility { get; set; } + public string[] DefaultTags => + new[] { $"via:@{Account}", "via:mastodon-bookmark-sync"}; } diff --git a/BookmarkSync.Infrastructure/Services/Bookmarking/Pinboard/PinboardBookmarkingService.cs b/BookmarkSync.Infrastructure/Services/Bookmarking/Pinboard/PinboardBookmarkingService.cs index 15391f3..1812d14 100644 --- a/BookmarkSync.Infrastructure/Services/Bookmarking/Pinboard/PinboardBookmarkingService.cs +++ b/BookmarkSync.Infrastructure/Services/Bookmarking/Pinboard/PinboardBookmarkingService.cs @@ -40,7 +40,7 @@ public async Task Save(Bookmark bookmark) { query["extended"] = extended; } - query["tags"] = string.Join(" ", $"via:@{bookmark.Account}", "via:mastodon-bookmark-sync"); + query["tags"] = string.Join(" ", bookmark.DefaultTags); builder.Query = query.ToString(); var requestUri = builder.ToString(); _logger.Debug("Request URI: {RequestUri}", requestUri);