Merge pull request #2624 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-05-08 14:08:21 -04:00 committed by GitHub
commit c8c4eb3ab5
17 changed files with 94 additions and 78 deletions

View File

@ -294,6 +294,15 @@ namespace Emby.Server.Core.IO
return; return;
} }
if (_environmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Windows)
{
if (path.StartsWith("\\\\", StringComparison.OrdinalIgnoreCase) || path.StartsWith("smb://", StringComparison.OrdinalIgnoreCase))
{
// not supported
return;
}
}
// Already being watched // Already being watched
if (_fileSystemWatchers.ContainsKey(path)) if (_fileSystemWatchers.ContainsKey(path))
{ {

View File

@ -60,7 +60,7 @@ namespace Emby.Server.Implementations.Activity
{ {
using (var statement = db.PrepareStatement("replace into ActivityLogEntries (Id, Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity) values (@Id, @Name, @Overview, @ShortOverview, @Type, @ItemId, @UserId, @DateCreated, @LogSeverity)")) using (var statement = db.PrepareStatement("replace into ActivityLogEntries (Id, Name, Overview, ShortOverview, Type, ItemId, UserId, DateCreated, LogSeverity) values (@Id, @Name, @Overview, @ShortOverview, @Type, @ItemId, @UserId, @DateCreated, @LogSeverity)"))
{ {
statement.TryBind("@Id", entry.Id.ToGuidParamValue()); statement.TryBind("@Id", entry.Id.ToGuidBlob());
statement.TryBind("@Name", entry.Name); statement.TryBind("@Name", entry.Name);
statement.TryBind("@Overview", entry.Overview); statement.TryBind("@Overview", entry.Overview);
@ -168,7 +168,7 @@ namespace Emby.Server.Implementations.Activity
var info = new ActivityLogEntry var info = new ActivityLogEntry
{ {
Id = reader[index].ReadGuid().ToString("N") Id = reader[index].ReadGuidFromBlob().ToString("N")
}; };
index++; index++;

View File

@ -106,8 +106,8 @@ namespace Emby.Server.Implementations.Data
using (var statement = connection.PrepareStatement("replace into userdisplaypreferences (id, userid, client, data) values (@id, @userId, @client, @data)")) using (var statement = connection.PrepareStatement("replace into userdisplaypreferences (id, userid, client, data) values (@id, @userId, @client, @data)"))
{ {
statement.TryBind("@id", displayPreferences.Id.ToGuidParamValue()); statement.TryBind("@id", displayPreferences.Id.ToGuidBlob());
statement.TryBind("@userId", userId.ToGuidParamValue()); statement.TryBind("@userId", userId.ToGuidBlob());
statement.TryBind("@client", client); statement.TryBind("@client", client);
statement.TryBind("@data", serialized); statement.TryBind("@data", serialized);
@ -170,8 +170,8 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = connection.PrepareStatement("select data from userdisplaypreferences where id = @id and userId=@userId and client=@client")) using (var statement = connection.PrepareStatement("select data from userdisplaypreferences where id = @id and userId=@userId and client=@client"))
{ {
statement.TryBind("@id", guidId.ToGuidParamValue()); statement.TryBind("@id", guidId.ToGuidBlob());
statement.TryBind("@userId", userId.ToGuidParamValue()); statement.TryBind("@userId", userId.ToGuidBlob());
statement.TryBind("@client", client); statement.TryBind("@client", client);
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
@ -204,7 +204,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = connection.PrepareStatement("select data from userdisplaypreferences where userId=@userId")) using (var statement = connection.PrepareStatement("select data from userdisplaypreferences where userId=@userId"))
{ {
statement.TryBind("@userId", userId.ToGuidParamValue()); statement.TryBind("@userId", userId.ToGuidBlob());
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
{ {

View File

@ -26,17 +26,17 @@ namespace Emby.Server.Implementations.Data
}); });
} }
public static byte[] ToGuidParamValue(this string str) public static byte[] ToGuidBlob(this string str)
{ {
return ToGuidParamValue(new Guid(str)); return ToGuidBlob(new Guid(str));
} }
public static byte[] ToGuidParamValue(this Guid guid) public static byte[] ToGuidBlob(this Guid guid)
{ {
return guid.ToByteArray(); return guid.ToByteArray();
} }
public static Guid ReadGuid(this IResultSetValue result) public static Guid ReadGuidFromBlob(this IResultSetValue result)
{ {
return new Guid(result.ToBlob()); return new Guid(result.ToBlob());
} }
@ -172,7 +172,7 @@ namespace Emby.Server.Implementations.Data
public static Guid GetGuid(this IReadOnlyList<IResultSetValue> result, int index) public static Guid GetGuid(this IReadOnlyList<IResultSetValue> result, int index)
{ {
return result[index].ReadGuid(); return result[index].ReadGuidFromBlob();
} }
private static void CheckName(string name) private static void CheckName(string name)
@ -262,7 +262,7 @@ namespace Emby.Server.Implementations.Data
IBindParameter bindParam; IBindParameter bindParam;
if (statement.BindParameters.TryGetValue(name, out bindParam)) if (statement.BindParameters.TryGetValue(name, out bindParam))
{ {
bindParam.Bind(value.ToGuidParamValue()); bindParam.Bind(value.ToGuidBlob());
} }
else else
{ {

View File

@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.Data
using (var statement = db.PrepareStatement(commandText)) using (var statement = db.PrepareStatement(commandText))
{ {
statement.TryBind("@ResultId", result.Id.ToGuidParamValue()); statement.TryBind("@ResultId", result.Id.ToGuidBlob());
statement.TryBind("@OriginalPath", result.OriginalPath); statement.TryBind("@OriginalPath", result.OriginalPath);
statement.TryBind("@TargetPath", result.TargetPath); statement.TryBind("@TargetPath", result.TargetPath);
@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = db.PrepareStatement("delete from FileOrganizerResults where ResultId = @ResultId")) using (var statement = db.PrepareStatement("delete from FileOrganizerResults where ResultId = @ResultId"))
{ {
statement.TryBind("@ResultId", id.ToGuidParamValue()); statement.TryBind("@ResultId", id.ToGuidBlob());
statement.MoveNext(); statement.MoveNext();
} }
}, TransactionMode); }, TransactionMode);
@ -188,7 +188,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = connection.PrepareStatement("select ResultId, OriginalPath, TargetPath, FileLength, OrganizationDate, Status, OrganizationType, StatusMessage, ExtractedName, ExtractedYear, ExtractedSeasonNumber, ExtractedEpisodeNumber, ExtractedEndingEpisodeNumber, DuplicatePaths from FileOrganizerResults where ResultId=@ResultId")) using (var statement = connection.PrepareStatement("select ResultId, OriginalPath, TargetPath, FileLength, OrganizationDate, Status, OrganizationType, StatusMessage, ExtractedName, ExtractedYear, ExtractedSeasonNumber, ExtractedEpisodeNumber, ExtractedEndingEpisodeNumber, DuplicatePaths from FileOrganizerResults where ResultId=@ResultId"))
{ {
statement.TryBind("@ResultId", id.ToGuidParamValue()); statement.TryBind("@ResultId", id.ToGuidBlob());
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
{ {
@ -207,7 +207,7 @@ namespace Emby.Server.Implementations.Data
var result = new FileOrganizationResult var result = new FileOrganizationResult
{ {
Id = reader[0].ReadGuid().ToString("N") Id = reader[0].ReadGuidFromBlob().ToString("N")
}; };
index++; index++;

View File

@ -2128,7 +2128,7 @@ namespace Emby.Server.Implementations.Data
connection.RunInTransaction(db => connection.RunInTransaction(db =>
{ {
// First delete chapters // First delete chapters
db.Execute("delete from " + ChaptersTableName + " where ItemId=@ItemId", id.ToGuidParamValue()); db.Execute("delete from " + ChaptersTableName + " where ItemId=@ItemId", id.ToGuidBlob());
using (var saveChapterStatement = PrepareStatement(db, "replace into " + ChaptersTableName + " (ItemId, ChapterIndex, StartPositionTicks, Name, ImagePath, ImageDateModified) values (@ItemId, @ChapterIndex, @StartPositionTicks, @Name, @ImagePath, @ImageDateModified)")) using (var saveChapterStatement = PrepareStatement(db, "replace into " + ChaptersTableName + " (ItemId, ChapterIndex, StartPositionTicks, Name, ImagePath, ImageDateModified) values (@ItemId, @ChapterIndex, @StartPositionTicks, @Name, @ImagePath, @ImageDateModified)"))
{ {
@ -2139,7 +2139,7 @@ namespace Emby.Server.Implementations.Data
saveChapterStatement.Reset(); saveChapterStatement.Reset();
} }
saveChapterStatement.TryBind("@ItemId", id.ToGuidParamValue()); saveChapterStatement.TryBind("@ItemId", id.ToGuidBlob());
saveChapterStatement.TryBind("@ChapterIndex", index); saveChapterStatement.TryBind("@ChapterIndex", index);
saveChapterStatement.TryBind("@StartPositionTicks", chapter.StartPositionTicks); saveChapterStatement.TryBind("@StartPositionTicks", chapter.StartPositionTicks);
saveChapterStatement.TryBind("@Name", chapter.Name); saveChapterStatement.TryBind("@Name", chapter.Name);
@ -2919,7 +2919,7 @@ namespace Emby.Server.Implementations.Data
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
{ {
list.Add(row[0].ReadGuid()); list.Add(row[0].ReadGuidFromBlob());
} }
} }
@ -3113,7 +3113,7 @@ namespace Emby.Server.Implementations.Data
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
{ {
list.Add(row[0].ReadGuid()); list.Add(row[0].ReadGuidFromBlob());
} }
} }
} }
@ -3643,7 +3643,7 @@ namespace Emby.Server.Implementations.Data
clauses.Add("(select Name from TypedBaseItems where guid=" + paramName + ") in (select Name from People where ItemId=Guid)"); clauses.Add("(select Name from TypedBaseItems where guid=" + paramName + ") in (select Name from People where ItemId=Guid)");
if (statement != null) if (statement != null)
{ {
statement.TryBind(paramName, personId.ToGuidParamValue()); statement.TryBind(paramName, personId.ToGuidBlob());
} }
index++; index++;
} }
@ -3843,7 +3843,7 @@ namespace Emby.Server.Implementations.Data
clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type<=1)"); clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type<=1)");
if (statement != null) if (statement != null)
{ {
statement.TryBind(paramName, artistId.ToGuidParamValue()); statement.TryBind(paramName, artistId.ToGuidBlob());
} }
index++; index++;
} }
@ -3862,7 +3862,7 @@ namespace Emby.Server.Implementations.Data
clauses.Add("Album in (select Name from typedbaseitems where guid=" + paramName + ")"); clauses.Add("Album in (select Name from typedbaseitems where guid=" + paramName + ")");
if (statement != null) if (statement != null)
{ {
statement.TryBind(paramName, albumId.ToGuidParamValue()); statement.TryBind(paramName, albumId.ToGuidBlob());
} }
index++; index++;
} }
@ -3881,7 +3881,7 @@ namespace Emby.Server.Implementations.Data
clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") not in (select CleanValue from itemvalues where ItemId=Guid and Type<=1)"); clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") not in (select CleanValue from itemvalues where ItemId=Guid and Type<=1)");
if (statement != null) if (statement != null)
{ {
statement.TryBind(paramName, artistId.ToGuidParamValue()); statement.TryBind(paramName, artistId.ToGuidBlob());
} }
index++; index++;
} }
@ -3900,7 +3900,7 @@ namespace Emby.Server.Implementations.Data
clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type=2)"); clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type=2)");
if (statement != null) if (statement != null)
{ {
statement.TryBind(paramName, genreId.ToGuidParamValue()); statement.TryBind(paramName, genreId.ToGuidBlob());
} }
index++; index++;
} }
@ -3953,7 +3953,7 @@ namespace Emby.Server.Implementations.Data
clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type=3)"); clauses.Add("(select CleanName from TypedBaseItems where guid=" + paramName + ") in (select CleanValue from itemvalues where ItemId=Guid and Type=3)");
if (statement != null) if (statement != null)
{ {
statement.TryBind(paramName, studioId.ToGuidParamValue()); statement.TryBind(paramName, studioId.ToGuidBlob());
} }
index++; index++;
} }
@ -4521,22 +4521,22 @@ namespace Emby.Server.Implementations.Data
connection.RunInTransaction(db => connection.RunInTransaction(db =>
{ {
// Delete people // Delete people
ExecuteWithSingleParam(db, "delete from People where ItemId=@Id", id.ToGuidParamValue()); ExecuteWithSingleParam(db, "delete from People where ItemId=@Id", id.ToGuidBlob());
// Delete chapters // Delete chapters
ExecuteWithSingleParam(db, "delete from " + ChaptersTableName + " where ItemId=@Id", id.ToGuidParamValue()); ExecuteWithSingleParam(db, "delete from " + ChaptersTableName + " where ItemId=@Id", id.ToGuidBlob());
// Delete media streams // Delete media streams
ExecuteWithSingleParam(db, "delete from mediastreams where ItemId=@Id", id.ToGuidParamValue()); ExecuteWithSingleParam(db, "delete from mediastreams where ItemId=@Id", id.ToGuidBlob());
// Delete ancestors // Delete ancestors
ExecuteWithSingleParam(db, "delete from AncestorIds where ItemId=@Id", id.ToGuidParamValue()); ExecuteWithSingleParam(db, "delete from AncestorIds where ItemId=@Id", id.ToGuidBlob());
// Delete item values // Delete item values
ExecuteWithSingleParam(db, "delete from ItemValues where ItemId=@Id", id.ToGuidParamValue()); ExecuteWithSingleParam(db, "delete from ItemValues where ItemId=@Id", id.ToGuidBlob());
// Delete the item // Delete the item
ExecuteWithSingleParam(db, "delete from TypedBaseItems where guid=@Id", id.ToGuidParamValue()); ExecuteWithSingleParam(db, "delete from TypedBaseItems where guid=@Id", id.ToGuidBlob());
}, TransactionMode); }, TransactionMode);
} }
} }
@ -4643,7 +4643,7 @@ namespace Emby.Server.Implementations.Data
whereClauses.Add("ItemId=@ItemId"); whereClauses.Add("ItemId=@ItemId");
if (statement != null) if (statement != null)
{ {
statement.TryBind("@ItemId", query.ItemId.ToGuidParamValue()); statement.TryBind("@ItemId", query.ItemId.ToGuidBlob());
} }
} }
if (query.AppearsInItemId != Guid.Empty) if (query.AppearsInItemId != Guid.Empty)
@ -4651,7 +4651,7 @@ namespace Emby.Server.Implementations.Data
whereClauses.Add("Name in (Select Name from People where ItemId=@AppearsInItemId)"); whereClauses.Add("Name in (Select Name from People where ItemId=@AppearsInItemId)");
if (statement != null) if (statement != null)
{ {
statement.TryBind("@AppearsInItemId", query.AppearsInItemId.ToGuidParamValue()); statement.TryBind("@AppearsInItemId", query.AppearsInItemId.ToGuidBlob());
} }
} }
var queryPersonTypes = query.PersonTypes.Where(IsValidPersonType).ToList(); var queryPersonTypes = query.PersonTypes.Where(IsValidPersonType).ToList();
@ -4730,14 +4730,14 @@ namespace Emby.Server.Implementations.Data
// First delete // First delete
deleteAncestorsStatement.Reset(); deleteAncestorsStatement.Reset();
deleteAncestorsStatement.TryBind("@ItemId", itemId.ToGuidParamValue()); deleteAncestorsStatement.TryBind("@ItemId", itemId.ToGuidBlob());
deleteAncestorsStatement.MoveNext(); deleteAncestorsStatement.MoveNext();
foreach (var ancestorId in ancestorIds) foreach (var ancestorId in ancestorIds)
{ {
updateAncestorsStatement.Reset(); updateAncestorsStatement.Reset();
updateAncestorsStatement.TryBind("@ItemId", itemId.ToGuidParamValue()); updateAncestorsStatement.TryBind("@ItemId", itemId.ToGuidBlob());
updateAncestorsStatement.TryBind("@AncestorId", ancestorId.ToGuidParamValue()); updateAncestorsStatement.TryBind("@AncestorId", ancestorId.ToGuidBlob());
updateAncestorsStatement.TryBind("@AncestorIdText", ancestorId.ToString("N")); updateAncestorsStatement.TryBind("@AncestorIdText", ancestorId.ToString("N"));
updateAncestorsStatement.MoveNext(); updateAncestorsStatement.MoveNext();
} }
@ -5198,7 +5198,7 @@ namespace Emby.Server.Implementations.Data
CheckDisposed(); CheckDisposed();
// First delete // First delete
db.Execute("delete from ItemValues where ItemId=@Id", itemId.ToGuidParamValue()); db.Execute("delete from ItemValues where ItemId=@Id", itemId.ToGuidBlob());
using (var statement = PrepareStatement(db, "insert into ItemValues (ItemId, Type, Value, CleanValue) values (@ItemId, @Type, @Value, @CleanValue)")) using (var statement = PrepareStatement(db, "insert into ItemValues (ItemId, Type, Value, CleanValue) values (@ItemId, @Type, @Value, @CleanValue)"))
{ {
@ -5214,7 +5214,7 @@ namespace Emby.Server.Implementations.Data
statement.Reset(); statement.Reset();
statement.TryBind("@ItemId", itemId.ToGuidParamValue()); statement.TryBind("@ItemId", itemId.ToGuidBlob());
statement.TryBind("@Type", pair.Item1); statement.TryBind("@Type", pair.Item1);
statement.TryBind("@Value", itemValue); statement.TryBind("@Value", itemValue);
@ -5252,7 +5252,7 @@ namespace Emby.Server.Implementations.Data
{ {
// First delete // First delete
// "delete from People where ItemId=?" // "delete from People where ItemId=?"
connection.Execute("delete from People where ItemId=?", itemId.ToGuidParamValue()); connection.Execute("delete from People where ItemId=?", itemId.ToGuidBlob());
var listIndex = 0; var listIndex = 0;
@ -5266,7 +5266,7 @@ namespace Emby.Server.Implementations.Data
statement.Reset(); statement.Reset();
} }
statement.TryBind("@ItemId", itemId.ToGuidParamValue()); statement.TryBind("@ItemId", itemId.ToGuidBlob());
statement.TryBind("@Name", person.Name); statement.TryBind("@Name", person.Name);
statement.TryBind("@Role", person.Role); statement.TryBind("@Role", person.Role);
statement.TryBind("@PersonType", person.Type); statement.TryBind("@PersonType", person.Type);
@ -5339,7 +5339,7 @@ namespace Emby.Server.Implementations.Data
using (var statement = PrepareStatementSafe(connection, cmdText)) using (var statement = PrepareStatementSafe(connection, cmdText))
{ {
statement.TryBind("@ItemId", query.ItemId.ToGuidParamValue()); statement.TryBind("@ItemId", query.ItemId.ToGuidBlob());
if (query.Type.HasValue) if (query.Type.HasValue)
{ {
@ -5383,7 +5383,7 @@ namespace Emby.Server.Implementations.Data
using (var connection = CreateConnection()) using (var connection = CreateConnection())
{ {
// First delete chapters // First delete chapters
connection.Execute("delete from mediastreams where ItemId=@ItemId", id.ToGuidParamValue()); connection.Execute("delete from mediastreams where ItemId=@ItemId", id.ToGuidBlob());
using (var statement = PrepareStatement(connection, string.Format("replace into mediastreams ({0}) values ({1})", using (var statement = PrepareStatement(connection, string.Format("replace into mediastreams ({0}) values ({1})",
string.Join(",", _mediaStreamSaveColumns), string.Join(",", _mediaStreamSaveColumns),
@ -5393,7 +5393,7 @@ namespace Emby.Server.Implementations.Data
{ {
var paramList = new List<object>(); var paramList = new List<object>();
paramList.Add(id.ToGuidParamValue()); paramList.Add(id.ToGuidBlob());
paramList.Add(stream.Index); paramList.Add(stream.Index);
paramList.Add(stream.Type.ToString()); paramList.Add(stream.Type.ToString());
paramList.Add(stream.Codec); paramList.Add(stream.Codec);

View File

@ -213,7 +213,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = db.PrepareStatement("replace into userdata (key, userId, rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex) values (@key, @userId, @rating,@played,@playCount,@isFavorite,@playbackPositionTicks,@lastPlayedDate,@AudioStreamIndex,@SubtitleStreamIndex)")) using (var statement = db.PrepareStatement("replace into userdata (key, userId, rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex) values (@key, @userId, @rating,@played,@playCount,@isFavorite,@playbackPositionTicks,@lastPlayedDate,@AudioStreamIndex,@SubtitleStreamIndex)"))
{ {
statement.TryBind("@userId", userId.ToGuidParamValue()); statement.TryBind("@userId", userId.ToGuidBlob());
statement.TryBind("@key", key); statement.TryBind("@key", key);
if (userData.Rating.HasValue) if (userData.Rating.HasValue)
@ -311,7 +311,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = connection.PrepareStatement("select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where key =@Key and userId=@UserId")) using (var statement = connection.PrepareStatement("select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where key =@Key and userId=@UserId"))
{ {
statement.TryBind("@UserId", userId.ToGuidParamValue()); statement.TryBind("@UserId", userId.ToGuidBlob());
statement.TryBind("@Key", key); statement.TryBind("@Key", key);
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
@ -364,7 +364,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = connection.PrepareStatement("select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where userId=@UserId")) using (var statement = connection.PrepareStatement("select key,userid,rating,played,playCount,isFavorite,playbackPositionTicks,lastPlayedDate,AudioStreamIndex,SubtitleStreamIndex from userdata where userId=@UserId"))
{ {
statement.TryBind("@UserId", userId.ToGuidParamValue()); statement.TryBind("@UserId", userId.ToGuidBlob());
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
{ {
@ -386,7 +386,7 @@ namespace Emby.Server.Implementations.Data
var userData = new UserItemData(); var userData = new UserItemData();
userData.Key = reader[0].ToString(); userData.Key = reader[0].ToString();
userData.UserId = reader[1].ReadGuid(); userData.UserId = reader[1].ReadGuidFromBlob();
if (reader[2].SQLiteType != SQLiteType.Null) if (reader[2].SQLiteType != SQLiteType.Null)
{ {

View File

@ -93,7 +93,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = db.PrepareStatement("replace into users (guid, data) values (@guid, @data)")) using (var statement = db.PrepareStatement("replace into users (guid, data) values (@guid, @data)"))
{ {
statement.TryBind("@guid", user.Id.ToGuidParamValue()); statement.TryBind("@guid", user.Id.ToGuidBlob());
statement.TryBind("@data", serialized); statement.TryBind("@data", serialized);
statement.MoveNext(); statement.MoveNext();
} }
@ -116,7 +116,7 @@ namespace Emby.Server.Implementations.Data
{ {
foreach (var row in connection.Query("select guid,data from users")) foreach (var row in connection.Query("select guid,data from users"))
{ {
var id = row[0].ReadGuid(); var id = row[0].ReadGuidFromBlob();
using (var stream = _memoryStreamProvider.CreateNew(row[1].ToBlob())) using (var stream = _memoryStreamProvider.CreateNew(row[1].ToBlob()))
{ {
@ -156,7 +156,7 @@ namespace Emby.Server.Implementations.Data
{ {
using (var statement = db.PrepareStatement("delete from users where guid=@id")) using (var statement = db.PrepareStatement("delete from users where guid=@id"))
{ {
statement.TryBind("@id", user.Id.ToGuidParamValue()); statement.TryBind("@id", user.Id.ToGuidBlob());
statement.MoveNext(); statement.MoveNext();
} }
}, TransactionMode); }, TransactionMode);

View File

@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.Notifications
} }
clauses.Add("UserId=?"); clauses.Add("UserId=?");
paramList.Add(query.UserId.ToGuidParamValue()); paramList.Add(query.UserId.ToGuidBlob());
var whereClause = " where " + string.Join(" And ", clauses.ToArray()); var whereClause = " where " + string.Join(" And ", clauses.ToArray());
@ -133,7 +133,7 @@ namespace Emby.Server.Implementations.Notifications
using (var statement = connection.PrepareStatement("select Level from Notifications where UserId=@UserId and IsRead=@IsRead")) using (var statement = connection.PrepareStatement("select Level from Notifications where UserId=@UserId and IsRead=@IsRead"))
{ {
statement.TryBind("@IsRead", false); statement.TryBind("@IsRead", false);
statement.TryBind("@UserId", userId.ToGuidParamValue()); statement.TryBind("@UserId", userId.ToGuidBlob());
var levels = new List<NotificationLevel>(); var levels = new List<NotificationLevel>();
@ -159,8 +159,8 @@ namespace Emby.Server.Implementations.Notifications
{ {
var notification = new Notification var notification = new Notification
{ {
Id = reader[0].ReadGuid().ToString("N"), Id = reader[0].ReadGuidFromBlob().ToString("N"),
UserId = reader[1].ReadGuid().ToString("N"), UserId = reader[1].ReadGuidFromBlob().ToString("N"),
Date = reader[2].ReadDateTime(), Date = reader[2].ReadDateTime(),
Name = reader[3].ToString() Name = reader[3].ToString()
}; };
@ -251,8 +251,8 @@ namespace Emby.Server.Implementations.Notifications
{ {
using (var statement = conn.PrepareStatement("replace into Notifications (Id, UserId, Date, Name, Description, Url, Level, IsRead, Category, RelatedId) values (@Id, @UserId, @Date, @Name, @Description, @Url, @Level, @IsRead, @Category, @RelatedId)")) using (var statement = conn.PrepareStatement("replace into Notifications (Id, UserId, Date, Name, Description, Url, Level, IsRead, Category, RelatedId) values (@Id, @UserId, @Date, @Name, @Description, @Url, @Level, @IsRead, @Category, @RelatedId)"))
{ {
statement.TryBind("@Id", notification.Id.ToGuidParamValue()); statement.TryBind("@Id", notification.Id.ToGuidBlob());
statement.TryBind("@UserId", notification.UserId.ToGuidParamValue()); statement.TryBind("@UserId", notification.UserId.ToGuidBlob());
statement.TryBind("@Date", notification.Date.ToDateTimeParamValue()); statement.TryBind("@Date", notification.Date.ToDateTimeParamValue());
statement.TryBind("@Name", notification.Name); statement.TryBind("@Name", notification.Name);
statement.TryBind("@Description", notification.Description); statement.TryBind("@Description", notification.Description);
@ -315,7 +315,7 @@ namespace Emby.Server.Implementations.Notifications
using (var statement = conn.PrepareStatement("update Notifications set IsRead=@IsRead where UserId=@UserId")) using (var statement = conn.PrepareStatement("update Notifications set IsRead=@IsRead where UserId=@UserId"))
{ {
statement.TryBind("@IsRead", isRead); statement.TryBind("@IsRead", isRead);
statement.TryBind("@UserId", userId.ToGuidParamValue()); statement.TryBind("@UserId", userId.ToGuidBlob());
statement.MoveNext(); statement.MoveNext();
} }
@ -337,13 +337,13 @@ namespace Emby.Server.Implementations.Notifications
using (var statement = conn.PrepareStatement("update Notifications set IsRead=@IsRead where UserId=@UserId and Id=@Id")) using (var statement = conn.PrepareStatement("update Notifications set IsRead=@IsRead where UserId=@UserId and Id=@Id"))
{ {
statement.TryBind("@IsRead", isRead); statement.TryBind("@IsRead", isRead);
statement.TryBind("@UserId", userId.ToGuidParamValue()); statement.TryBind("@UserId", userId.ToGuidBlob());
foreach (var id in notificationIdList) foreach (var id in notificationIdList)
{ {
statement.Reset(); statement.Reset();
statement.TryBind("@Id", id.ToGuidParamValue()); statement.TryBind("@Id", id.ToGuidBlob());
statement.MoveNext(); statement.MoveNext();
} }

View File

@ -74,7 +74,7 @@ namespace Emby.Server.Implementations.Security
{ {
using (var statement = db.PrepareStatement("replace into AccessTokens (Id, AccessToken, DeviceId, AppName, AppVersion, DeviceName, UserId, IsActive, DateCreated, DateRevoked) values (@Id, @AccessToken, @DeviceId, @AppName, @AppVersion, @DeviceName, @UserId, @IsActive, @DateCreated, @DateRevoked)")) using (var statement = db.PrepareStatement("replace into AccessTokens (Id, AccessToken, DeviceId, AppName, AppVersion, DeviceName, UserId, IsActive, DateCreated, DateRevoked) values (@Id, @AccessToken, @DeviceId, @AppName, @AppVersion, @DeviceName, @UserId, @IsActive, @DateCreated, @DateRevoked)"))
{ {
statement.TryBind("@Id", info.Id.ToGuidParamValue()); statement.TryBind("@Id", info.Id.ToGuidBlob());
statement.TryBind("@AccessToken", info.AccessToken); statement.TryBind("@AccessToken", info.AccessToken);
statement.TryBind("@DeviceId", info.DeviceId); statement.TryBind("@DeviceId", info.DeviceId);
@ -259,7 +259,7 @@ namespace Emby.Server.Implementations.Security
using (var statement = connection.PrepareStatement(commandText)) using (var statement = connection.PrepareStatement(commandText))
{ {
statement.BindParameters["@Id"].Bind(id.ToGuidParamValue()); statement.BindParameters["@Id"].Bind(id.ToGuidBlob());
foreach (var row in statement.ExecuteQuery()) foreach (var row in statement.ExecuteQuery())
{ {
@ -275,7 +275,7 @@ namespace Emby.Server.Implementations.Security
{ {
var info = new AuthenticationInfo var info = new AuthenticationInfo
{ {
Id = reader[0].ReadGuid().ToString("N"), Id = reader[0].ReadGuidFromBlob().ToString("N"),
AccessToken = reader[1].ToString() AccessToken = reader[1].ToString()
}; };

View File

@ -61,7 +61,7 @@ namespace Emby.Server.Implementations.Social
var commandText = "replace into Shares (Id, ItemId, UserId, ExpirationDate) values (?, ?, ?, ?)"; var commandText = "replace into Shares (Id, ItemId, UserId, ExpirationDate) values (?, ?, ?, ?)";
db.Execute(commandText, db.Execute(commandText,
info.Id.ToGuidParamValue(), info.Id.ToGuidBlob(),
info.ItemId, info.ItemId,
info.UserId, info.UserId,
info.ExpirationDate.ToDateTimeParamValue()); info.ExpirationDate.ToDateTimeParamValue());
@ -84,7 +84,7 @@ namespace Emby.Server.Implementations.Social
var commandText = "select Id, ItemId, UserId, ExpirationDate from Shares where id = ?"; var commandText = "select Id, ItemId, UserId, ExpirationDate from Shares where id = ?";
var paramList = new List<object>(); var paramList = new List<object>();
paramList.Add(id.ToGuidParamValue()); paramList.Add(id.ToGuidBlob());
foreach (var row in connection.Query(commandText, paramList.ToArray())) foreach (var row in connection.Query(commandText, paramList.ToArray()))
{ {
@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.Social
{ {
var info = new SocialShareInfo(); var info = new SocialShareInfo();
info.Id = reader[0].ReadGuid().ToString("N"); info.Id = reader[0].ReadGuidFromBlob().ToString("N");
info.ItemId = reader[1].ToString(); info.ItemId = reader[1].ToString();
info.UserId = reader[2].ToString(); info.UserId = reader[2].ToString();
info.ExpirationDate = reader[3].ReadDateTime(); info.ExpirationDate = reader[3].ReadDateTime();

View File

@ -664,9 +664,19 @@ namespace Emby.Server.Implementations.Updates
// Remove it the quick way for now // Remove it the quick way for now
_applicationHost.RemovePlugin(plugin); _applicationHost.RemovePlugin(plugin);
_logger.Info("Deleting plugin file {0}", plugin.AssemblyFilePath); var path = plugin.AssemblyFilePath;
_logger.Info("Deleting plugin file {0}", path);
_fileSystem.DeleteFile(plugin.AssemblyFilePath); // Make this case-insensitive to account for possible incorrect assembly naming
var file = _fileSystem.GetFilePaths(path)
.FirstOrDefault(i => string.Equals(i, path, StringComparison.OrdinalIgnoreCase));
if (!string.IsNullOrWhiteSpace(file))
{
path = file;
}
_fileSystem.DeleteFile(path);
OnPluginUninstalled(plugin); OnPluginUninstalled(plugin);

View File

@ -50,10 +50,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
return false; return false;
} }
if (logOutput) _logger.Info("ffmpeg info: {0}", output);
{
_logger.Info("ffmpeg info: {0}", output);
}
if (output.IndexOf("Libav developers", StringComparison.OrdinalIgnoreCase) != -1) if (output.IndexOf("Libav developers", StringComparison.OrdinalIgnoreCase) != -1)
{ {

View File

@ -443,7 +443,7 @@ namespace MediaBrowser.Providers.TV
private async Task<RemoteSearchResult> FindByExternalId(string id, string externalSource, CancellationToken cancellationToken) private async Task<RemoteSearchResult> FindByExternalId(string id, string externalSource, CancellationToken cancellationToken)
{ {
var url = string.Format("https://api.themoviedb.org/3/tv/find/{0}?api_key={1}&external_source={2}", var url = string.Format("https://api.themoviedb.org/3/find/{0}?api_key={1}&external_source={2}",
id, id,
MovieDbProvider.ApiKey, MovieDbProvider.ApiKey,
externalSource); externalSource);

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.699</version> <version>3.0.700</version>
<title>Emby.Common</title> <title>Emby.Common</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.699</version> <version>3.0.700</version>
<title>Emby.Server.Core</title> <title>Emby.Server.Core</title>
<authors>Emby Team</authors> <authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description> <description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright> <copyright>Copyright © Emby 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.699" /> <dependency id="MediaBrowser.Common" version="3.0.700" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

View File

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.14.2")] [assembly: AssemblyVersion("3.2.15.1")]