Skip to content

Commit

Permalink
Updated VideoCodecs (HEVC) and AudioCodecs (TrueHD+Atmos, DTSX, EAC3+…
Browse files Browse the repository at this point in the history
…Atmos, EAC3) support.
  • Loading branch information
damienhaynes committed Sep 2, 2018
1 parent d788050 commit 31217cc
Show file tree
Hide file tree
Showing 5 changed files with 672 additions and 648 deletions.
10 changes: 4 additions & 6 deletions Cornerstone/Database/DatabaseCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading;

namespace Cornerstone.Database {
// This class is primarily intended to ensure that when I database object is selected
// This class is primarily intended to ensure that when a database object is selected
// multiple times from two different places in the code, both places will be working
// with the same physical c# object. It also reduces retrieval time for get(id) type
// queries.
Expand All @@ -29,15 +29,14 @@ public DatabaseTable Get(Type type, int id) {
else return null;
}


public ICollection<DatabaseTable> GetAll(Type type) {
if (cache.ContainsKey(type))
return cache[type].Values;

return new List<DatabaseTable>();
}

// Adds the given element to the cacheing system
// Adds the given element to the cacheing system.
public DatabaseTable Add(DatabaseTable obj) {
if (obj == null || obj.ID == null)
return obj;
Expand Down Expand Up @@ -71,15 +70,15 @@ public void Sync(IList<DatabaseTable> list) {
}
}

// Shoudl really only be called if an item has been deleted from the database
// Should only be called if an item has been deleted from the database.
public void Remove(DatabaseTable obj) {
if (obj == null || obj.ID == null)
return;

cache[obj.GetType()].Remove((int)obj.ID);
}

// remove the existing object with the same ID from the cache and store this one instead.
// Remove the existing object with the same ID from the cache and store this one instead.
public void Replace(DatabaseTable obj) {
if (obj == null || obj.ID == null)
return;
Expand All @@ -89,7 +88,6 @@ public void Replace(DatabaseTable obj) {

cache[obj.GetType()][(int)obj.ID] = obj;
}


}
}
12 changes: 4 additions & 8 deletions Cornerstone/ScraperEngine/Nodes/RetrieveNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ public string Cookies {
get { return cookies; }
} protected string cookies = null;

public string AcceptLanguage {
get { return acceptLanguage; }
public string AcceptLanguage {
get { return acceptLanguage; }
} protected string acceptLanguage = null;

public string Method {
get { return _method; }
} protected string _method;


#endregion

#region Methods
Expand Down Expand Up @@ -88,8 +87,8 @@ public RetrieveNode(XmlNode xmlNode, ScriptableScraper context)
case "useragent":
userAgent = attr.Value;
break;
case "accept_language":
acceptLanguage = attr.Value;
case "accept_language":
acceptLanguage = attr.Value;
break;
case "allow_unsafe_header":
try { allowUnsafeHeader = bool.Parse(attr.Value); }
Expand Down Expand Up @@ -267,9 +266,6 @@ private string ReadFile(Dictionary<string, string> variables) {

return fileContents;
}



#endregion
}
}
10 changes: 5 additions & 5 deletions Cornerstone/Tools/WebGrabber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public string Accept {
set { _accept = value; }
} private string _accept;

public string AcceptLanguage {
get { return _acceptLanguage; }
set { _acceptLanguage = value; }
public string AcceptLanguage {
get { return _acceptLanguage; }
set { _acceptLanguage = value; }
} private string _acceptLanguage;

#endregion
Expand Down Expand Up @@ -137,8 +137,8 @@ public bool GetResponse() {
request.UserAgent = userAgent;
request.Method = _method;
request.Accept = _accept;
if (_acceptLanguage != null) {
request.Headers.Add("Accept-Language", _acceptLanguage);
if (_acceptLanguage != null) {
request.Headers.Add("Accept-Language", _acceptLanguage);
}
request.CookieContainer = new CookieContainer();

Expand Down
Loading

0 comments on commit 31217cc

Please # to comment.