Skip to content

Commit 5fb19f3

Browse files
committed
Add project files.
1 parent 24073a6 commit 5fb19f3

31 files changed

+38291
-0
lines changed

Launchbox Local Scraper.sln

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launchbox Local Scraper", "Launchbox Local Scraper\Launchbox Local Scraper.csproj", "{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}"
7+
ProjectSection(ProjectDependencies) = postProject
8+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A} = {F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}
9+
EndProjectSection
10+
EndProject
11+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FolderSelect", "..\Folder Selector\FolderSelect.csproj", "{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}"
12+
EndProject
13+
Global
14+
GlobalSection(Performance) = preSolution
15+
HasPerformanceSessions = true
16+
EndGlobalSection
17+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
18+
Debug|Any CPU = Debug|Any CPU
19+
Debug|x86 = Debug|x86
20+
Release|Any CPU = Release|Any CPU
21+
Release|x86 = Release|x86
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Debug|x86.ActiveCfg = Debug|Any CPU
27+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Debug|x86.Build.0 = Debug|Any CPU
28+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
29+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Release|Any CPU.Build.0 = Release|Any CPU
30+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Release|x86.ActiveCfg = Release|Any CPU
31+
{E11A01F6-AACD-47B6-BDE8-8005495AA6C5}.Release|x86.Build.0 = Release|Any CPU
32+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Debug|x86.ActiveCfg = Debug|x86
35+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Debug|x86.Build.0 = Debug|x86
36+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Release|x86.ActiveCfg = Release|x86
39+
{F4A7CCFF-3855-4F01-A146-4BE677B5FC4A}.Release|x86.Build.0 = Release|x86
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
EndGlobal

Launchbox Local Scraper/App.config

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<configSections>
4+
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
5+
<section name="Launchbox_Local_Scraper.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
6+
</sectionGroup>
7+
</configSections>
8+
<startup>
9+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
10+
</startup>
11+
<userSettings>
12+
<Launchbox_Local_Scraper.Properties.Settings>
13+
<setting name="launchboxPath" serializeAs="String">
14+
<value />
15+
</setting>
16+
<setting name="videosPath" serializeAs="String">
17+
<value />
18+
</setting>
19+
<setting name="onlyShowMissing" serializeAs="String">
20+
<value>True</value>
21+
</setting>
22+
<setting name="SkipPlatforms" serializeAs="String">
23+
<value>True</value>
24+
</setting>
25+
<setting name="renameOriginal" serializeAs="String">
26+
<value>True</value>
27+
</setting>
28+
<setting name="runForOnePlatform" serializeAs="String">
29+
<value>False</value>
30+
</setting>
31+
<setting name="doThemesAlso" serializeAs="String">
32+
<value>True</value>
33+
</setting>
34+
<setting name="doVideoSnaps" serializeAs="String">
35+
<value>True</value>
36+
</setting>
37+
<setting name="doAudio" serializeAs="String">
38+
<value>True</value>
39+
</setting>
40+
<setting name="doImages" serializeAs="String">
41+
<value>True</value>
42+
</setting>
43+
<setting name="audioPath" serializeAs="String">
44+
<value />
45+
</setting>
46+
<setting name="imagesPath" serializeAs="String">
47+
<value />
48+
</setting>
49+
</Launchbox_Local_Scraper.Properties.Settings>
50+
</userSettings>
51+
</configuration>

Launchbox Local Scraper/Class1.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Launchbox_Local_Scraper
8+
{
9+
class Class1
10+
{
11+
}
12+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Forms;
8+
using Microsoft.VisualBasic.FileIO;
9+
10+
namespace Launchbox_Local_Scraper
11+
{
12+
class FileToBeCopied
13+
{
14+
// RoboCommand backup;/// <summary>
15+
/// /////////////////////////////////////////////////////////////////////
16+
/// </summary>
17+
private string platLBVidFolder;
18+
private string platOriginalVidFolder;
19+
private string gameName;
20+
private string ext;
21+
private string fileToCopy;
22+
private bool renameOriginalVideos;
23+
private bool weAreDoingArcade;
24+
private string romName;
25+
26+
public FileToBeCopied(string platformLaunchboxVideoFolder, string platformOriginalVideoFolder, string gameName, string extension,
27+
string fileToCopy, bool renameOriginalVideos, bool weAreDoingArcade, string romFileName)
28+
{
29+
this.platLBVidFolder = platformLaunchboxVideoFolder;
30+
this.platOriginalVidFolder = platformOriginalVideoFolder;
31+
this.gameName = gameName;
32+
this.ext = extension;
33+
this.fileToCopy = fileToCopy;
34+
this.renameOriginalVideos = renameOriginalVideos;
35+
this.weAreDoingArcade = weAreDoingArcade;
36+
this.romName = romFileName;
37+
}
38+
39+
private string concatenateVideoPath(string videoFolder)
40+
{
41+
string correctFileName;
42+
43+
if (weAreDoingArcade)
44+
correctFileName = romName;
45+
else
46+
correctFileName = generalUtils.removeInvalidCharsWindowsFileSystem(gameName);
47+
48+
return Path.GetFullPath(videoFolder + @"\" + (correctFileName) + ext);
49+
}
50+
51+
public void processFileAsyncTask()
52+
{
53+
generalUtils.createFolderIfDoesntExist(platLBVidFolder);
54+
55+
try
56+
{
57+
File.Copy(fileToCopy, concatenateVideoPath(platLBVidFolder));
58+
59+
if (renameOriginalVideos && ! weAreDoingArcade) //only rename videos if they havent got mame filenames, because user might make mistake...
60+
{
61+
string newFilePath = concatenateVideoPath(platOriginalVidFolder);
62+
63+
if (!newFilePath.ToUpper().Equals(fileToCopy.ToUpper())) //if the new file name is different than the original, all in upercase because windows is stupid
64+
{
65+
Directory.Move(fileToCopy, newFilePath); //renames original file to correct name
66+
}
67+
}
68+
}
69+
70+
catch (Exception except)
71+
{
72+
MessageBox.Show(
73+
"Couldn't create file.\n Check if you have permissions\n. Exception:" + except.Message.ToString());
74+
}
75+
}
76+
77+
/// <summary>
78+
/// copies file to launchbox folder and renames original file if renameOriginalVideos is true
79+
/// </summary>
80+
public void processFile()
81+
{
82+
// processFileAsyncTask();
83+
//do async because we don't want to wait for files to copy...
84+
Task task = new Task(new Action(processFileAsyncTask));
85+
task.Start();
86+
}
87+
88+
public string getNewOriginalFilePath()
89+
{
90+
return concatenateVideoPath(platOriginalVidFolder);
91+
}
92+
}
93+
}

0 commit comments

Comments
 (0)