Skip to content

Commit

Permalink
V10.4.X-1.0 (#28)
Browse files Browse the repository at this point in the history
* Update the videos/playlists pull pipelines to automatically refresh the search index to prevent a race condition (#14)

Co-authored-by: Cody Rodgers <[email protected]>

* v10.1.X-3.6 (#18)

* V10.2.0.3 (#16)

* Fixed broken DXF configuration content for labels/folders

* Add more error handling to the folder and labels property value readers

* Fix bug preventing new labels from being synced

* Remove automatic re-indexing from the videos/playlists pipeline

---------

Co-authored-by: Cody Rodgers <[email protected]>

* Add missing embed media buttons

* Reorganize DEF files

* Update the DEF GET pipelines to have better error handling and removed broken SetFolderSettings code

* Update the DEF resolve pipelines to have better error handling

* Updated the UPDATE DEF pipelines to have better logging and error handling

* Update playlist/video pipelines to accuratly reflect video name changes made outside of Sitecore

* Fix bug preventing deleted Brightcove items from being deleted in Sitecore

* Fix broken standard values for experience items

* Update the Brightcove services to trim account ids/secrets

* Update logging levels on video/player pipelines

* Update all pipelines to handle name changes

* Update sitecore package creation script to include patching instructions

* Update the pull pipelines to support creating items in languages other an "en"

* Update all template fields to be shared

* Update the push pipelines to support creating items in languages other than "en"

* Update the folder/labels value readers to have better error handling

* Add support for embedding medai links again. It was removed as part of the upgrade but returned on client request

* Update the resolve asset item pipeline step to rename resolved items if the name has been changed since creation

* Fix the brightcove settings config so it loads both html editor scripts correctly

* Update sitecore package creation script

---------

Co-authored-by: Cody Rodgers <[email protected]>

* V10.2.X-5 (#22)

* Update the videos/playlists pull pipelines to automatically refresh the search index to prevent a race condition (#14)

Co-authored-by: Cody Rodgers <[email protected]>

* v10.1.X-3.6 (#18)

* V10.2.0.3 (#16)

* Fixed broken DXF configuration content for labels/folders

* Add more error handling to the folder and labels property value readers

* Fix bug preventing new labels from being synced

* Remove automatic re-indexing from the videos/playlists pipeline

---------

Co-authored-by: Cody Rodgers <[email protected]>

* Add missing embed media buttons

* Reorganize DEF files

* Update the DEF GET pipelines to have better error handling and removed broken SetFolderSettings code

* Update the DEF resolve pipelines to have better error handling

* Updated the UPDATE DEF pipelines to have better logging and error handling

* Update playlist/video pipelines to accuratly reflect video name changes made outside of Sitecore

* Fix bug preventing deleted Brightcove items from being deleted in Sitecore

* Fix broken standard values for experience items

* Update the Brightcove services to trim account ids/secrets

* Update logging levels on video/player pipelines

* Update all pipelines to handle name changes

* Update sitecore package creation script to include patching instructions

* Update the pull pipelines to support creating items in languages other an "en"

* Update all template fields to be shared

* Update the push pipelines to support creating items in languages other than "en"

* Update the folder/labels value readers to have better error handling

* Add support for embedding medai links again. It was removed as part of the upgrade but returned on client request

* Update the resolve asset item pipeline step to rename resolved items if the name has been changed since creation

* Fix the brightcove settings config so it loads both html editor scripts correctly

* Update sitecore package creation script

---------

Co-authored-by: Cody Rodgers <[email protected]>

* Fix bug which prevents the user from embedding media in the Siteocre RTE in certain scenarios

* Add support for syncing video scheduling/status information

* Reserialize content

* Add some help text to the new scheduling fields

---------

Co-authored-by: Cody Rodgers <[email protected]>

* v10.1.X-37 (#21)

* Fix bug which prevents the user from embedding media in the Siteocre RTE in certain scenarios

* Add support for syncing video scheduling/status information

* Reserialize content

* Add some help text to the new scheduling fields

---------

Co-authored-by: Cody Rodgers <[email protected]>

* Update the embed generator to include an optional alt-text field for iframe accessibility support

* Update all Brightcove templates/items to be unpublishable to prevent unnecessary performance hits

* Update the pull pipeline processors to use the ItemModelRepository and cleanup unnecessary DB requests

* Update the pull pipelines to set and use a new global last sync timestamp

* Update the push pipelines to use the new last sync time

* Update the video push pipeline to suppor the new last sync time field

* Update the value reader/writers to include consistent exception handling

* Update playlist/video page size to 1000

* Update the resolve asset item pipeline to dedup content items

* Add the new clean pipeline batch

* Add retry logic to the brightcove service

* Fix loadPlayer script

* Content Updates

* Update the package/library references to target version 10.4 and add default web.config

* Fix build errors and web.config

* Fix various bugs

---------

Co-authored-by: Cody Rodgers <[email protected]>
  • Loading branch information
codrod and rdacrodgers authored Nov 11, 2024
1 parent ef533a3 commit df16e6a
Show file tree
Hide file tree
Showing 204 changed files with 4,026 additions and 2,480 deletions.
1 change: 1 addition & 0 deletions Brightcove.Core/Brightcove.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
2 changes: 2 additions & 0 deletions Brightcove.Core/EmbedGenerator/Models/EmbedModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class EmbedModel

public string Language { get; set; } = "";

public string Title { get; set; } = "";

public EmbedModel()
{

Expand Down
5 changes: 4 additions & 1 deletion Brightcove.Core/Models/Experience.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ namespace Brightcove.Core.Models
/// </summary>
public class Experience : Asset
{
[JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)]
[JsonProperty("createdAt", NullValueHandling = NullValueHandling.Ignore)]
public DateTime CreationDate { get; set; }

[JsonProperty("updatedAt", NullValueHandling = NullValueHandling.Ignore)]
public new DateTime? LastModifiedDate { get; set; }

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

Expand Down
3 changes: 3 additions & 0 deletions Brightcove.Core/Models/Video.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public class Video : Asset
[JsonProperty("schedule", NullValueHandling = NullValueHandling.Ignore)]
public VideoSchedule Schedule { get; set; }

[JsonProperty("variants", NullValueHandling = NullValueHandling.Ignore)]
public List<VideoVariant> Variants { get; set; }

public Video ShallowCopy()
{
return (Video)this.MemberwiseClone();
Expand Down
1 change: 1 addition & 0 deletions Brightcove.Core/Services/BrightcoveHttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static class BrightcoveHttpClient
static BrightcoveHttpClient()
{
Instance = new HttpClient();
Instance.Timeout = TimeSpan.FromSeconds(30);
}
}
}
38 changes: 28 additions & 10 deletions Brightcove.Core/Services/BrightcoveService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public class BrightcoveService
{
readonly static HttpClient client = BrightcoveHttpClient.Instance;

int retryMax = 3;
int retryAttempt = 0;

readonly string cmsBaseUrl = "https://cms.api.brightcove.com/v1/accounts";
readonly string ingestBaseUrl = "https://ingest.api.brightcove.com/v1/accounts";
readonly string playersBaseUrl = "https://players.api.brightcove.com/v1/accounts";
Expand Down Expand Up @@ -306,6 +309,7 @@ public Video UpdateVideo(Video video)
Video newVideo = video.ShallowCopy();
newVideo.Id = null;
newVideo.Images = null;
newVideo.Variants = null;

string content = JsonConvert.SerializeObject(newVideo);

Expand Down Expand Up @@ -519,12 +523,12 @@ public PlayerList GetPlayers()
return players;
}

public ExperienceList GetExperiences()
public ExperienceList GetExperiences(string query = "", string sort = "")
{
HttpRequestMessage request = new HttpRequestMessage();

request.Method = HttpMethod.Get;
request.RequestUri = new Uri($"{experienceBaseUrl}/{accountId}/experiences");
request.RequestUri = new Uri($"{experienceBaseUrl}/{accountId}/experiences?query={query}&sort={sort}");

HttpResponseMessage response = SendRequest(request);

Expand Down Expand Up @@ -719,12 +723,12 @@ public bool TryGetPlaylist(string playlistId, out PlayList playlist)
return true;
}

public int VideosCount()
public int VideosCount(string query = "")
{
HttpRequestMessage request = new HttpRequestMessage();

request.Method = HttpMethod.Get;
request.RequestUri = new Uri($"{cmsBaseUrl}/{accountId}/counts/videos");
request.RequestUri = new Uri($"{cmsBaseUrl}/{accountId}/counts/videos?query={query}");

HttpResponseMessage response = SendRequest(request);
Count count = JsonConvert.DeserializeObject<Count>(response.Content.ReadAsString());
Expand All @@ -747,16 +751,30 @@ public int PlayListsCount()

private HttpResponseMessage SendRequest(HttpRequestMessage request)
{
request.Headers.Authorization = authenticationService.CreateAuthenticationHeader();
try
{
request.Headers.Authorization = authenticationService.CreateAuthenticationHeader();

HttpResponseMessage response = client.Send(request);
HttpResponseMessage response = client.Send(request);

if (!response.IsSuccessStatusCode)
{
throw new HttpStatusException(request, response);
if (!response.IsSuccessStatusCode)
{
throw new HttpStatusException(request, response);
}

return response;
}
catch(Exception ex)
{
if(retryAttempt < retryMax)
{
retryAttempt++;
return SendRequest(request);
}

return response;
retryAttempt = 0;
throw ex;
}
}
}
}
Loading

0 comments on commit df16e6a

Please sign in to comment.