Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
0a34e467
Commit
0a34e467
authored
9 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add new anonymous property. Fix extended description reading.
Add documentation comment at beginning of file.
parent
82dc5e95
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/filebase.js
+29
-5
29 additions, 5 deletions
exec/load/filebase.js
with
29 additions
and
5 deletions
exec/load/filebase.js
+
29
−
5
View file @
0a34e467
...
...
@@ -3,8 +3,28 @@
* in the specified directory.
*
* Similar to filedir.js.
*
* Each element in the array is an object with the following properties:
*
* base: Base filename.
* ext: Filename extension.
* datoffset: Offset in .dat file of file data.
* uldate: Date uploaded
* dldate: Date downloaded(?)
* credits: Number of credits(?)
* desc: Short description (58 chars max)
* uploader: Name of user that uploaded the file.
* downloaded: Number of times the file has been downloaded.
* opencount: I have no idea what this is.
* misc: Misc flags... see FM_* below.
* anonymous: Anonymous upload
* altpath: Index into the internal array of alt paths (not visible to JavaScript)
* extdesc: May be undefined... extended description.
*/
var
FM_EXTDESC
=
1
;
var
FM_ANON
=
(
1
<<
1
);
function
FileBase
(
dir
)
{
var
f
=
new
File
(
format
(
"
%s%s.ixb
"
,
file_area
.
dir
[
dir
].
data_dir
,
dir
));
var
dat
=
new
File
(
format
(
"
%s%s.dat
"
,
file_area
.
dir
[
dir
].
data_dir
,
dir
));
...
...
@@ -12,7 +32,7 @@ function FileBase(dir) {
var
record
=
null
;
var
ret
=
[];
function
FileEntry
(
idx
)
{
function
FileEntry
()
{
var
byte
;
function
getrec
(
file
,
len
)
{
...
...
@@ -47,13 +67,17 @@ function FileBase(dir) {
this
.
misc
=
ascii
(
this
.
misc
)
-
32
;
else
this
.
misc
=
0
;
if
(
this
.
misc
&
FM_ANON
)
this
.
anonymous
=
true
;
else
this
.
anonymous
=
false
;
this
.
altpath
=
parseInt
(
getrec
(
dat
,
2
),
16
);
// Read from the EXB file
this
.
extdesc
=
''
;
if
(
exb
.
is_open
)
{
if
(
exb
.
length
>
idx
*
512
)
{
exb
.
position
=
idx
*
512
;
var
exbpos
=
(
dat
.
position
/
118
)
*
512
;
if
(
exb
.
is_open
&&
(
this
.
misc
&
FM_EXTDESC
)
)
{
if
(
exb
.
length
>
exbpos
)
{
exb
.
position
=
exbpos
;
this
.
extdesc
=
exb
.
read
(
512
).
replace
(
/
\x
00.*$/
,
''
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment