Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Core/Comments.vb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Namespace Spotlib

End If

WorkLoad = Spotz.CreateWork(lFirst, lLast)
WorkLoad = Spotz.CreateWork(lFirst, lLast, 100000)
WorkTotal = WorkLoad.Count

If WorkTotal < 1 Then
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Headers.vb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Namespace Spotlib
WorkCnt = 0
SUbTotal = 0

WorkLoad = Spotz.CreateWork(lFirst, lLast)
WorkLoad = Spotz.CreateWork(lFirst, lLast, 100000)

WorkTotal = WorkLoad.Count
WorkCounter = WorkTotal
Expand Down
13 changes: 11 additions & 2 deletions src/Core/Protocol.vb
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ Namespace Spotlib

End Function

Friend Shared Function CreateWork(ByVal sFirst As Long, ByVal sLast As Long) As List(Of NNTPWork)
Friend Shared Function CreateWork(ByVal sFirst As Long, ByVal sLast As Long, ByVal sMax As Long) As List(Of NNTPWork)

Dim xWork As NNTPWork
Dim WorkCol As New List(Of NNTPWork)
Expand All @@ -600,7 +600,16 @@ Namespace Spotlib

TotalMSG = (sLast - sFirst) + 1

If TotalMSG < 1 Then Return New List(Of NNTPWork)
If TotalMSG > sMax Then

TotalMSG = sMax
sLast = sFirst + (sMax - 1)

Else

If TotalMSG < 1 Then Return New List(Of NNTPWork)

End If

If TotalMSG > FastPacket Then
FastPos = sFirst + (TotalMSG - FastPacket)
Expand Down
25 changes: 19 additions & 6 deletions src/Core/Provider.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Imports System.Data.Common
Imports DataVirtualization
Imports System.Diagnostics


Namespace Spotlib
Public Class SpotProvider

Expand All @@ -27,6 +28,9 @@ Namespace Spotlib
Private _SortOrder As String = "asc"
Private _SortColumn As String = "rowid"

Public Parms As iWorkParams


Public Property SortOrder() As String
Get
Return _SortOrder
Expand Down Expand Up @@ -161,13 +165,15 @@ Namespace Spotlib

Debug.Print("LoadRange: " & CStr(startIndex))

Dim MaxResults As Integer = 5000 '' TODO: CInt(Param.MaxResults)

Dim MaxResults As Integer = CInt(Parms.MaxResults)

If MaxResults <= 0 Then MaxResults = -1 ' Oude setting

If CacheQueryCount < 1 Then
CacheQueryCount = -1
If ((_RowFilter = Spotz.DefaultFilter) Or (Len(_RowFilter) = 0)) Then
CacheQueryCount = 999999999 '' TODO: CInt(Param.DatabaseFilter)
CacheQueryCount = CInt(Parms.DatabaseFilter)
End If
End If

Expand All @@ -194,12 +200,12 @@ Namespace Spotlib

Dim sQ As String

Throw New NotImplementedException()
'Throw New NotImplementedException()

If Not Spots.IsSearchQuery(_RowFilter) Then
sQ = CreateQuery("asc", "rowid", MaxResults, sOffset, CountQuery)
sQ = CreateQuery(SortOrder, SortCol, MaxResults, sOffset, CountQuery)
Else
sQ = CreateSearchQuery(0, "asc", "rowid", MaxResults, sOffset, CountQuery)
sQ = CreateSearchQuery(Parms.DatabaseMax, SortOrder, SortCol, MaxResults, sOffset, CountQuery)
End If

lPosIndex = 4
Expand Down Expand Up @@ -338,6 +344,13 @@ Namespace Spotlib
End If

If sQ.Contains("[SN:DATE]") Then sQ = Strings.Replace(sQ, "[SN:DATE]", CStr(fDate()), 1, , CompareMethod.Binary)
If sQ.Contains("[SN:NEW]") Then
If _RowNew > 1 Then
sQ = Strings.Replace(sQ, "[SN:NEW]", Convert.ToString(_RowNew), 1, , CompareMethod.Binary)
Else
sQ = Strings.Replace(sQ, "[SN:NEW]", Convert.ToString(Parms.DatabaseMax + 1), 1, , CompareMethod.Binary)
End If
End If

Dim SelectID As String = "rowid"
Dim SelectTable As String = "spots"
Expand All @@ -361,7 +374,7 @@ Namespace Spotlib
If (MaxResults < 1) Or (SortCol = "rowid" And SortOrder.ToLower = "desc") Then
sQ = sPrefix & SelectTable & sQ & RowSort & sOffset
Else
sQ = sPrefix & SelectTable & " WHERE " & SelectID & " IN (SELECT " & SelectID & " FROM " & SelectTable & sQ & " ORDER BY " & SelectID & " DESC" & " LIMIT " & MaxResults & ") " & RowSort & sOffset
sQ = sPrefix & SelectTable & " WHERE " & SelectID & " IN (SELECT " & SelectID & " FROM " & SelectTable & sQ & " ORDER BY " & SelectID & " DESC LIMIT " & MaxResults & ") " & RowSort & sOffset
End If

Debug.Print("SQL Query: " & sQ)
Expand Down
4 changes: 2 additions & 2 deletions src/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Imports System.Reflection
<Assembly: AssemblyTitle("Spotlib")>
<Assembly: AssemblyDescription("Library for Spotnet")>
<Assembly: AssemblyProduct("Spotlib")>
<Assembly: AssemblyVersion("0.9.0.0")>
<Assembly: AssemblyVersion("1.8.4.3")>
<Assembly: Guid("3A541D6D-6B12-4418-9F42-B26806F658B6")>
<Assembly: AssemblyFileVersion("0.9.0.0")>
<Assembly: AssemblyFileVersion("1.8.4.3")>
<Assembly: AssemblyCopyright("All Rights Reversed")>
'Imports System
'Imports System.Reflection
Expand Down
16 changes: 10 additions & 6 deletions src/Spotlib.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@
<MyType>Windows</MyType>
</PropertyGroup>
<ItemGroup>
<Reference Include="DataVirtualization">
<HintPath>Vendor\VirtualData.dll</HintPath>
</Reference>
<Reference Include="Fusenet">
<HintPath>Vendor\Fusenet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite">
Expand Down Expand Up @@ -116,6 +110,16 @@
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\fusenet\src\Fusenet.csproj">
<Project>{abcbd5d0-09a6-45c7-8055-bd04da7b3665}</Project>
<Name>Fusenet</Name>
</ProjectReference>
<ProjectReference Include="VirtualData\VirtualData.csproj">
<Project>{48e0eb7c-30b3-4a98-89bc-732039bef625}</Project>
<Name>VirtualData</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
4 changes: 2 additions & 2 deletions src/VirtualData/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
[assembly: AssemblyVersion("1.8.4.3")]
[assembly: AssemblyFileVersion("1.8.4.3")]
[assembly: AllowPartiallyTrustedCallers]