Skip to content

Commit

Permalink
10.1.3.0 (#9)
Browse files Browse the repository at this point in the history
* Add a custom computed index field for the video labels field to support full text search

* Content updates

* Mock a response for the GetLabels method until support for labels is actually enabled

* Add a pull pipeline for labels

* Content Updates

* Update the video pull/push pipelines to support labels

* Content updates

* Add pipeline processor for resolving labels

* Add support for updating labels (renaming) labels

* Add support for deleting labels and some bug fixes/tweaks

* Content changes

* Enable full text search for the new brightcove folder field

* Content updates

* Create pull pipeline for folders

* Content updates

* Create push pipeline for folders

* Content updates

* Add support for syncing the folder field on video items

* Content updates

* Add a computed index field for the video folder field

* Content updates

* Content updates

* Add 10.1.3 package manifest to solution

Co-authored-by: Cody Rodgers <[email protected]>
  • Loading branch information
codrod and rdacrodgers authored Sep 1, 2022
1 parent 27ab888 commit a857765
Show file tree
Hide file tree
Showing 275 changed files with 6,281 additions and 198 deletions.
3 changes: 3 additions & 0 deletions Brightcove.Core/Brightcove.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<Compile Include="Models\IngestTextTrack.cs" />
<Compile Include="Models\IngestVideo.cs" />
<Compile Include="Models\Experience.cs" />
<Compile Include="Models\Label.cs" />
<Compile Include="Models\Player.cs" />
<Compile Include="Models\TemporaryIngestUrls.cs" />
<Compile Include="Models\Converters\BrightcovePlayListSearchFieldConverter.cs" />
Expand All @@ -67,6 +68,8 @@
<Compile Include="Models\PlayListSearch.cs" />
<Compile Include="Models\TagInclusion.cs" />
<Compile Include="Models\TextTrack.cs" />
<Compile Include="Models\Labels.cs" />
<Compile Include="Models\Folder.cs" />
<Compile Include="Models\VideoVariant.cs" />
<Compile Include="Models\Video.cs" />
<Compile Include="Models\VideoLink.cs" />
Expand Down
37 changes: 37 additions & 0 deletions Brightcove.Core/Models/Folder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Brightcove.Core.Models
{
public class Folder
{
[JsonProperty("account_id", NullValueHandling = NullValueHandling.Ignore)]
public string AccountId { get; set; }

[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
public string Id { get; set; }

[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
public string Name { get; set; }

[JsonProperty("video_count", NullValueHandling = NullValueHandling.Ignore)]
public int? VideoCount { get; set; }

[JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? CreationDate { get; set; }

[JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? UpdatedDate { get; set; }

[JsonIgnore()]
public DateTime LastSyncTime { get; set; }

public Folder ShallowCopy()
{
return (Folder)this.MemberwiseClone();
}
}
}
73 changes: 73 additions & 0 deletions Brightcove.Core/Models/Label.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.Linq;

namespace Brightcove.Core.Models
{
public class Label
{
[JsonProperty("path", NullValueHandling = NullValueHandling.Ignore)]
public string Path { get; set; }

[JsonProperty("new_label", NullValueHandling = NullValueHandling.Ignore)]
public string NewLabel { get; set; }

[JsonIgnore()]
public string SitecoreName { get; set; }

[JsonIgnore()]
public DateTime LastSyncTime { get; set; }

public Label()
{

}

public Label(string path)
{
Path = AddTrailingSlash(path);
SitecoreName = Path.Replace("/", "_");
}

public Label ShallowCopy()
{
return (Label)this.MemberwiseClone();
}

public static bool TryParse(string path, out Label label)
{
if(path.Length <= 1)
{
label = null;
return false;
}

if (path[0] != '/')
{
label = null;
return false;
}

label = new Label(path);
return true;
}

public string GetLeafLabel()
{
return Path.Split('/').Last();
}

private string AddTrailingSlash(string path)
{
if (path[path.Length - 1] != '/')
{
return path + '/';
}

return path;
}
}
}
25 changes: 25 additions & 0 deletions Brightcove.Core/Models/Labels.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Brightcove.Core.Models
{
public class Labels
{
[JsonProperty("account_id", NullValueHandling = NullValueHandling.Ignore)]
public string AccountId { get; set; }

[JsonProperty("labels", NullValueHandling = NullValueHandling.Ignore)]
public List<string> Paths { get; set; }

[JsonProperty("version", NullValueHandling = NullValueHandling.Ignore)]
public int Version { get; set; }

public Labels ShallowCopy()
{
return (Labels)this.MemberwiseClone();
}
}
}
6 changes: 6 additions & 0 deletions Brightcove.Core/Models/Video.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ public class Video : Asset
[JsonProperty("sharing", NullValueHandling = NullValueHandling.Ignore)]
public VideoSharing Sharing { get; set; }

[JsonProperty("labels", NullValueHandling = NullValueHandling.Ignore)]
public List<string> Labels { get; set; }

[JsonProperty("folder_id", NullValueHandling = NullValueHandling.Ignore)]
public string Folder { get; set; }

[JsonIgnore]
public string IngestJobId { get; set; }

Expand Down
Loading

0 comments on commit a857765

Please sign in to comment.