mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Remove unneeded code.
This commit is contained in:
@@ -35,13 +35,18 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
using System.Web.UI;
|
||||
using System.Xml.Serialization;
|
||||
using DiscImageChef.Interop;
|
||||
using DiscImageChef.Metadata;
|
||||
using PlatformID = DiscImageChef.Interop.PlatformID;
|
||||
|
||||
namespace DiscImageChef.Server
|
||||
{
|
||||
public partial class Statistics : System.Web.UI.Page
|
||||
public partial class Statistics : Page
|
||||
{
|
||||
class MediaItem
|
||||
{
|
||||
@@ -72,12 +77,12 @@ namespace DiscImageChef.Server
|
||||
|
||||
try
|
||||
{
|
||||
if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics",
|
||||
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics",
|
||||
"Statistics.xml")))
|
||||
{
|
||||
#if DEBUG
|
||||
content.InnerHtml = string.Format("<b>Sorry, cannot load data file \"{0}\"</b>",
|
||||
Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"),
|
||||
Path.Combine(HostingEnvironment.MapPath("~"),
|
||||
"Statistics", "Statistics.xml"));
|
||||
#else
|
||||
content.InnerHtml = "<b>Sorry, cannot load data file</b>";
|
||||
@@ -89,7 +94,7 @@ namespace DiscImageChef.Server
|
||||
|
||||
XmlSerializer xs = new XmlSerializer(statistics.GetType());
|
||||
FileStream fs =
|
||||
WaitForFile(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"),
|
||||
WaitForFile(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"),
|
||||
FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
statistics = (Stats)xs.Deserialize(fs);
|
||||
fs.Close();
|
||||
@@ -101,8 +106,8 @@ namespace DiscImageChef.Server
|
||||
operatingSystems.Add(new NameValueStats
|
||||
{
|
||||
name = string.Format("{0}{1}{2}",
|
||||
Interop.DetectOS
|
||||
.GetPlatformName((Interop.PlatformID)Enum.Parse(typeof(Interop.PlatformID), nvs.name),
|
||||
DetectOS
|
||||
.GetPlatformName((PlatformID)Enum.Parse(typeof(PlatformID), nvs.name),
|
||||
nvs.version),
|
||||
string.IsNullOrEmpty(nvs.version) ? "" : " ", nvs.version),
|
||||
Value = nvs.Value
|
||||
@@ -256,7 +261,7 @@ namespace DiscImageChef.Server
|
||||
|
||||
xmlFile = xmlFile.Replace('/', '_').Replace('\\', '_').Replace('?', '_');
|
||||
|
||||
if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports",
|
||||
if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Reports",
|
||||
xmlFile))) url = null;
|
||||
|
||||
devices.Add(new DeviceItem
|
||||
@@ -299,7 +304,7 @@ namespace DiscImageChef.Server
|
||||
catch(IOException)
|
||||
{
|
||||
if(fs != null) fs.Dispose();
|
||||
System.Threading.Thread.Sleep(50);
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user