mirror of
https://github.com/XFox111/GUTSchedule.git
synced 2026-04-22 06:58:01 +03:00
- Updated schedule parser
- Authorization via personal cabinet is temporarly disabled - Updated target Android version
This commit is contained in:
@@ -81,7 +81,7 @@ namespace GUTSchedule.Droid.Activities
|
||||
start.Text = startDate.ToShortDateString();
|
||||
|
||||
groupTitle.Checked = prefs.GetBoolean("AddGroupToHeader", false);
|
||||
authorize.Checked = prefs.GetBoolean("Authorize", true);
|
||||
//authorize.Checked = prefs.GetBoolean("Authorize", true);
|
||||
|
||||
email.Text = prefs.GetString("email", "");
|
||||
password.Text = prefs.GetString("password", "");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="0-development-test" package="com.xfox111.gut.schedule" android:installLocation="auto">
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28" />
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="29" />
|
||||
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/appName" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme.Light"></application>
|
||||
<uses-permission android:name="android.permission.READ_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
|
||||
|
||||
@@ -1,231 +1,234 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:theme="@style/AppTheme.Light">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:theme="@style/AppTheme.Light">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/scheduleParametersTitle"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16dp"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/authorization"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/authorizeCheckbox"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/scheduleParametersTitle"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/studentParams"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<CheckBox
|
||||
android:id="@+id/authorization"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:checked="false"
|
||||
android:text="@string/authorizeCheckbox"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/facultySpinner"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/studentParams"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/faculty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/facultySpinner"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/courseSpinner"/>
|
||||
<Spinner
|
||||
android:id="@+id/faculty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/course"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/courseSpinner"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/groupSpinner"/>
|
||||
<Spinner
|
||||
android:id="@+id/course"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/groupSpinner"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/professorParams"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
<Spinner
|
||||
android:id="@+id/group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="E-mail"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/professorParams"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textWebEmailAddress"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="E-mail"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/passwordField"/>
|
||||
<EditText
|
||||
android:id="@+id/email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textWebEmailAddress"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textWebPassword"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/passwordField"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exportParametersTitle"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16dp"/>
|
||||
<EditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textWebPassword"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dateRange"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exportParametersTitle"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16dp"/>
|
||||
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="*"
|
||||
android:shrinkColumns="*">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dateRange"/>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="20-Dec-2019"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/end"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="31-Dec-2019"/>
|
||||
</TableRow>
|
||||
<TableLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="*"
|
||||
android:shrinkColumns="*">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/forDay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forDayButton"/>
|
||||
<Button
|
||||
android:id="@+id/forWeek"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forWeekButton"/>
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/start"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="20-Dec-2019"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/forMonth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forMonthButton"/>
|
||||
<Button
|
||||
android:id="@+id/forSemester"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forSemesterButton"/>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
<Button
|
||||
android:id="@+id/end"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="31-Dec-2019"/>
|
||||
</TableRow>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reminderSpinner"/>
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/reminder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reminderNote"/>
|
||||
<Button
|
||||
android:id="@+id/forDay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forDayButton"/>
|
||||
<Button
|
||||
android:id="@+id/forWeek"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forWeekButton"/>
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/groupTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addGroupToTitleCheckbox"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/titleNote"/>
|
||||
<Button
|
||||
android:id="@+id/forMonth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forMonthButton"/>
|
||||
<Button
|
||||
android:id="@+id/forSemester"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forSemesterButton"/>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/destinationCalendarSpinner"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reminderSpinner"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/calendar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
<Spinner
|
||||
android:id="@+id/reminder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FF0000"
|
||||
android:text="Error"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:visibility="gone"/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/reminderNote"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/export"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addScheduleButton"/>
|
||||
<CheckBox
|
||||
android:id="@+id/groupTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addGroupToTitleCheckbox"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/copyrights"/>
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="v$(Build.BuildNumber) (ci-id #$(Build.BuildId))"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/titleNote"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/destinationCalendarSpinner"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/calendar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/error"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FF0000"
|
||||
android:text="Error"
|
||||
android:layout_marginVertical="5dp"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/export"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/addScheduleButton"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/copyrights"/>
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="v$(Build.BuildNumber) (ci-id #$(Build.BuildId))"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -4,6 +4,7 @@ using GUTSchedule.Models;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace GUTSchedule.Test
|
||||
{
|
||||
@@ -12,11 +13,13 @@ namespace GUTSchedule.Test
|
||||
[Test]
|
||||
public async Task ScheduleListTest()
|
||||
{
|
||||
dynamic secrets = JsonConvert.DeserializeObject(File.ReadAllText(Directory.GetCurrentDirectory() + "\\TestCredential.json"));
|
||||
Assert.Warn("Feature is temporarly disabled. Skipping test");
|
||||
Assert.Pass();
|
||||
/*JObject secrets = JsonConvert.DeserializeObject(File.ReadAllText(Directory.GetCurrentDirectory() + "\\TestCredential.json")) as JObject;
|
||||
var list = await Parser.GetSchedule(new CabinetExportParameters
|
||||
{
|
||||
Email = secrets.testEmail,
|
||||
Password = secrets.testPassword,
|
||||
Email = secrets["testEmail"].ToObject<string>(),
|
||||
Password = secrets["testPassword"].ToObject<string>(),
|
||||
EndDate = DateTime.Today.AddDays(7),
|
||||
StartDate = DateTime.Today
|
||||
});
|
||||
@@ -24,7 +27,6 @@ namespace GUTSchedule.Test
|
||||
Assert.IsNotNull(list);
|
||||
Assert.IsTrue(list.Count > 0);
|
||||
|
||||
|
||||
Console.WriteLine("Events list:");
|
||||
foreach (var i in list)
|
||||
{
|
||||
@@ -34,7 +36,7 @@ namespace GUTSchedule.Test
|
||||
Console.WriteLine(i.StartTime.ToShortDateString());
|
||||
Console.WriteLine($"{i.StartTime.ToShortTimeString()}-{i.EndTime.ToShortTimeString()}");
|
||||
Console.WriteLine(i.Opponent);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
|
||||
<ScrollViewer>
|
||||
<Grid x:Name="grid">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -63,7 +63,7 @@
|
||||
<StackPanel Padding="10" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||
<TextBlock x:Uid="scheduleParametersTitle" Style="{StaticResource SubtitleTextBlockStyle}" Text="Schedule parameters"/>
|
||||
|
||||
<CheckBox x:Uid="authorizeCheckbox" Content="Authorize via personal cabinet" Checked="ChangeAuthorizationMethod" Unchecked="ChangeAuthorizationMethod" IsChecked="True" x:Name="authorize"/>
|
||||
<CheckBox x:Uid="authorizeCheckbox" Content="Authorize via personal cabinet" Checked="ChangeAuthorizationMethod" Unchecked="ChangeAuthorizationMethod" IsChecked="False" IsEnabled="False" x:Name="authorize"/>
|
||||
<StackPanel x:Name="credentialMethod">
|
||||
<TextBox x:Uid="email" PlaceholderText="E-mail" x:Name="email" IsSpellCheckEnabled="False"/>
|
||||
<PasswordBox x:Uid="password" PlaceholderText="Password" x:Name="password"/>
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace GUTSchedule.UWP.Pages
|
||||
PackageVersion ver = Package.Current.Id.Version;
|
||||
version.Text = $"v{ver.Major}.{ver.Minor}.{ver.Build}.{ver.Revision}";
|
||||
|
||||
authorize.IsChecked = (bool?)settings.Values["Authorize"] ?? true;
|
||||
//authorize.IsChecked = (bool?)settings.Values["Authorize"] ?? true;
|
||||
if (vault.RetrieveAll() is IReadOnlyList<PasswordCredential> credentials && credentials.Count > 0)
|
||||
{
|
||||
email.Text = credentials.First().UserName;
|
||||
|
||||
@@ -64,10 +64,10 @@ namespace GUTSchedule
|
||||
}
|
||||
else if (exportParameters is DefaultExportParameters args)
|
||||
{
|
||||
int offsetDay = int.Parse(await new HttpClient().GetStringAsync("https://xfox111.net/API/GUTSchedule/SemesterOffsetDay"));
|
||||
DateTime startDate = new DateTime(long.Parse(await new HttpClient().GetStringAsync("https://xfox111.net/API/GUTSchedule/SemesterOffsetDay")));
|
||||
IHtmlDocument[] rawSchedule = await GetRawSchedule(args.FacultyId, args.Course, args.GroupId);
|
||||
if(rawSchedule[0] != null)
|
||||
schedule.AddRange(ParseRegularSchedule(offsetDay, rawSchedule[0]));
|
||||
schedule.AddRange(ParseRegularSchedule(startDate, rawSchedule[0]));
|
||||
if(rawSchedule[1] != null)
|
||||
schedule.AddRange(ParseSessionSchedule(rawSchedule[1]));
|
||||
}
|
||||
@@ -156,13 +156,12 @@ namespace GUTSchedule
|
||||
return $"205.{now.Year - 2000}{now.Year - 1999}/1";
|
||||
}
|
||||
|
||||
private static DateTime[] GetDatesFromWeeks(int offsetDay, int weekday, string[] weeks)
|
||||
private static DateTime[] GetDatesFromWeeks(DateTime date, int weekday, string[] weeks)
|
||||
{
|
||||
List<DateTime> dates = new List<DateTime>();
|
||||
foreach(string rawWeek in weeks)
|
||||
{
|
||||
int week = int.Parse(rawWeek.Replace("*", ""));
|
||||
DateTime date = new DateTime(DateTime.Today.Year, DateTime.Today.Month >= 8 ? 9 : 2, offsetDay);
|
||||
|
||||
date = date.AddDays(--week * 7);
|
||||
date = date.AddDays(weekday - 1);
|
||||
@@ -209,7 +208,7 @@ namespace GUTSchedule
|
||||
return docs;
|
||||
}
|
||||
|
||||
private static List<Occupation> ParseRegularSchedule(int offsetDay, IHtmlDocument raw)
|
||||
private static List<Occupation> ParseRegularSchedule(DateTime startDate, IHtmlDocument raw)
|
||||
{
|
||||
if (raw == null)
|
||||
throw new ArgumentNullException(nameof(raw));
|
||||
@@ -221,7 +220,7 @@ namespace GUTSchedule
|
||||
foreach (IElement item in pairs)
|
||||
{
|
||||
DateTime[] dates = GetDatesFromWeeks(
|
||||
offsetDay,
|
||||
startDate,
|
||||
int.Parse(item.GetAttribute("weekday")),
|
||||
item.QuerySelector(".weeks").TextContent.Replace("(", "").Replace("н)", "").Replace(" ", "").Split(','));
|
||||
|
||||
@@ -233,7 +232,7 @@ namespace GUTSchedule
|
||||
Name = item.QuerySelector(".subect").TextContent.Replace(" (1)", "").Replace(" (2)", ""),
|
||||
Type = item.QuerySelector(".type").TextContent.Replace("(", "").Replace(")", ""),
|
||||
Group = groupName,
|
||||
Opponent = item.QuerySelector(".teacher")?.GetAttribute("title").Replace("; ", "") ?? "",
|
||||
Opponent = item.QuerySelector(".teacher")?.GetAttribute("title").Replace("; ", "\n") ?? "",
|
||||
Cabinet = item.QuerySelector(".aud")?.TextContent.Replace("ауд.: ", "").Replace("; Б22", "").Replace(" ", "") ?? "СПбГУТ",
|
||||
Order = order > 50 ? $"Ф{order - 81}" : order.ToString()
|
||||
};
|
||||
@@ -310,7 +309,7 @@ namespace GUTSchedule
|
||||
|
||||
DateTime date = DateTime.Parse(item.FirstChild.FirstChild.TextContent, new CultureInfo("ru-RU"));
|
||||
string rawTime = item.ChildNodes[2].TextContent;
|
||||
try
|
||||
try
|
||||
{
|
||||
rawTime = rawTime.Substring(rawTime.IndexOf('(')).Replace(")", "").Replace('.', ':');
|
||||
occupation.StartTime = date.Add(TimeSpan.Parse(rawTime.Split('-')[0]));
|
||||
|
||||
@@ -13,7 +13,7 @@ Cross-platform application which exports SPbSUT timetable to calendar
|
||||
- Platforms: Xamarin.Android, Universal Windows Platform
|
||||
- Android:
|
||||
- Minimal version: 4.1 (API level 16 - Jelly Bean)
|
||||
- Target version: 9.0 (API level 28 - Pie)
|
||||
- Target version: 10.0 (API level 29 - Oreo)
|
||||
- UWP:
|
||||
- Minimal version: 1507 (10.0.10240)
|
||||
- Target version: 1709 (10.0.16299, Fall Creators Update)
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
- Fixed and improved parser
|
||||
- Updated schedule parser Обновлен парсер расписания
|
||||
- Authorization via personal cabinet is temporarly disabled
|
||||
- Updated target Android version
|
||||
@@ -1 +1,3 @@
|
||||
- Исправлен и улучшен парсер расписания
|
||||
- Обновлен парсер расписания
|
||||
- Функция авторизации через ЛК временно отключена
|
||||
- Обнавлена целевая версия Android
|
||||
@@ -1 +1,2 @@
|
||||
- Fixed and improved parser
|
||||
- Updated schedule parser Обновлен парсер расписания
|
||||
- Authorization via personal cabinet is temporarly disabled
|
||||
@@ -1 +1,2 @@
|
||||
- Исправлен и улучшен парсер расписания
|
||||
- Обновлен парсер расписания
|
||||
- Функция авторизации через ЛК временно отключена
|
||||
Reference in New Issue
Block a user