Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
14220290
Commit
14220290
authored
1 year ago
by
Gyan Gupta
Browse files
Options
Downloads
Patches
Plain Diff
Fixed fileset title uniqueness issue
parent
c3e6182e
Loading
Loading
1 merge request
!279
Fixed file_set title uniqueness issue
Pipeline
#13035
failed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hyrax/app/actors/hyrax/actors/file_actor.rb
+3
-3
3 additions, 3 deletions
hyrax/app/actors/hyrax/actors/file_actor.rb
with
3 additions
and
3 deletions
hyrax/app/actors/hyrax/actors/file_actor.rb
+
3
−
3
View file @
14220290
...
...
@@ -73,14 +73,14 @@ module Hyrax
# actual characterization service
def
set_characterization_data
(
s3_file_url
,
file_set
)
path
=
URI
.
parse
(
Addressable
::
URI
.
unencode
(
s3_file_url
)).
path
file_name
=
path
.
split
(
'/'
)[
-
1
]
file_name
=
path
.
split
(
'/'
)[
-
1
]
.
downcase
uploaded_file_id
=
path
.
split
(
'/'
)[
-
2
]
uploaded_file
=
Hyrax
::
UploadedFile
.
find
(
uploaded_file_id
)
parent_object
=
file_set
.
parent_object
siblings
=
parent_object
.
file_sets
duplicate_record
=
siblings
.
select
{
|
fs
|
fs
.
title
[
0
]
==
file_name
&&
fs
.
id
!=
file_set
.
id
}
duplicate_record
=
siblings
.
select
{
|
fs
|
fs
.
title
[
0
]
.
downcase
==
file_name
&&
fs
.
id
!=
file_set
.
id
}
new_title
=
nil
if
duplicate_record
.
present?
...
...
@@ -190,7 +190,7 @@ module Hyrax
end
def
genrate_file_set_title
(
siblings
,
file_name
)
existing_titles
=
siblings
.
map
{
|
fs
|
fs
.
title
[
0
]
}
existing_titles
=
siblings
.
map
{
|
fs
|
fs
.
title
[
0
]
.
downcase
}
base_name
,
extension
=
File
.
basename
(
file_name
,
".*"
),
File
.
extname
(
file_name
)
...
...
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