Skip to content

Commit

Permalink
Merged changes from 1.2.x branch (Mantis 3723 - Default graph status …
Browse files Browse the repository at this point in the history
…not set to stop on new installs / new cards)
  • Loading branch information
reg-server committed Sep 26, 2011
2 parents 42038f4 + aa9910e commit fbfe149
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 9 deletions.
5 changes: 5 additions & 0 deletions TvEngine3/TVLibrary/SetupTv/60_upgrade_mysql_database.sql
@@ -0,0 +1,5 @@
USE %TvLibrary%;

UPDATE Card SET stopgraph = 1;

UPDATE Version SET versionNumber = 60;
8 changes: 8 additions & 0 deletions TvEngine3/TVLibrary/SetupTv/60_upgrade_sqlserver_database.sql
@@ -0,0 +1,8 @@
use %TvLibrary%
GO

UPDATE Card SET stopgraph = 1
GO

UPDATE Version SET versionNumber=60
GO
2 changes: 2 additions & 0 deletions TvEngine3/TVLibrary/SetupTv/SetupTv.csproj
Expand Up @@ -663,6 +663,8 @@
<EmbeddedResource Include="40_upgrade_sqlserver_database.sql" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="60_upgrade_mysql_database.sql" />
<EmbeddedResource Include="60_upgrade_sqlserver_database.sql" />
<Content Include="images\animation.SatDish.gif" />
<Content Include="images\icon.card.gif" />
<Content Include="images\icon.computer.gif" />
Expand Down
49 changes: 41 additions & 8 deletions TvEngine3/TVLibrary/TVDatabase/Card.cs
Expand Up @@ -62,19 +62,46 @@ public class Card : Persistent, IComparable
[TableColumn("preload", NotNull = true)] private bool preloadCard;
[TableColumn("stopgraph", NotNull = true)] private bool stopGraph;

[TableColumn("CAM", NotNull = true)] private bool CAModule;
[TableColumn("CAM", NotNull = true)] private bool caModule;
[TableColumn("NetProvider", NotNull = true)] private int NetProvider;

#endregion

#region Constructors

/// <summary>
/// For backwards compatibility: do *not* use.
/// </summary>
[System.Obsolete("Use the constructor that provides access to all parameters.")]
public Card(string devicePath, string name, int priority, bool grabEPG, DateTime lastEpgGrab, string recordingFolder,
int idServer, bool enabled, int camType, string timeshiftingFolder, int recordingFormat,
int decryptLimit, int netProvider)
{
isChanged = true;
this.devicePath = devicePath;
this.name = name;
this.priority = priority;
this.grabEPG = grabEPG;
this.lastEpgGrab = lastEpgGrab;
this.recordingFolder = recordingFolder;
this.idServer = idServer;
this.enabled = enabled;
this.camType = camType;
this.timeshiftingFolder = timeshiftingFolder;
this.recordingFormat = recordingFormat;
this.decryptLimit = decryptLimit;
this.preloadCard = false;
this.stopGraph = true;
this.caModule = false;
this.NetProvider = netProvider;
}

/// <summary>
/// Create a new object by specifying all fields (except the auto-generated primary key field).
/// </summary>
public Card(string devicePath, string name, int priority, bool grabEPG, DateTime lastEpgGrab, string recordingFolder,
int idServer, bool enabled, int camType, string timeshiftingFolder, int recordingFormat,
int decryptLimit, int NetProvider)
int decryptLimit, bool preloadCard, bool stopGraph, bool caModule, int netProvider)
{
isChanged = true;
this.devicePath = devicePath;
Expand All @@ -89,7 +116,10 @@ public class Card : Persistent, IComparable
this.timeshiftingFolder = timeshiftingFolder;
this.recordingFormat = recordingFormat;
this.decryptLimit = decryptLimit;
this.NetProvider = NetProvider;
this.preloadCard = preloadCard;
this.stopGraph = stopGraph;
this.caModule = caModule;
this.NetProvider = netProvider;
}

/// <summary>
Expand All @@ -98,7 +128,7 @@ public class Card : Persistent, IComparable
/// </summary>
public Card(int idCard, string devicePath, string name, int priority, bool grabEPG, DateTime lastEpgGrab,
string recordingFolder, int idServer, bool enabled, int camType, string timeshiftingFolder,
int recordingFormat, int decryptLimit, int NetProvider)
int recordingFormat, int decryptLimit, bool preloadCard, bool stopGraph, bool caModule, int netProvider)
{
this.idCard = idCard;
this.devicePath = devicePath;
Expand All @@ -113,7 +143,10 @@ public class Card : Persistent, IComparable
this.timeshiftingFolder = timeshiftingFolder;
this.recordingFormat = recordingFormat;
this.decryptLimit = decryptLimit;
this.NetProvider = NetProvider;
this.preloadCard = preloadCard;
this.stopGraph = stopGraph;
this.caModule = caModule;
this.NetProvider = netProvider;
}

#endregion
Expand Down Expand Up @@ -181,11 +214,11 @@ public int DecryptLimit
/// </summary>
public bool CAM
{
get { return CAModule; }
get { return caModule; }
set
{
isChanged |= CAModule != value;
CAModule = value;
isChanged |= caModule != value;
caModule = value;
}
}

Expand Down
Expand Up @@ -128,7 +128,7 @@ public Card AddCard(string name, string devicePath, Server server)
// Card(devicePath, name, priority, grabEPG, lastEpgGrab, recordingFolder, idServer, enabled, camType, timeshiftingFolder, recordingFormat, decryptLimit)
//
Card newCard = new Card(devicePath, name, 1, true, new DateTime(2000, 1, 1), "", server.IdServer, true, 0, "", 0,
0, (int)TvDatabase.DbNetworkProvider.Generic);
0, false, true, false, (int)TvDatabase.DbNetworkProvider.Generic);
newCard.Persist();
return newCard;
}
Expand Down

0 comments on commit fbfe149

Please sign in to comment.