Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PracticaSDIS2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ismcarb
PracticaSDIS2
Commits
bb86ddf6
Commit
bb86ddf6
authored
May 18, 2024
by
ismcarb
Browse files
Options
Downloads
Patches
Plain Diff
Clase nueva del pdf
parent
8c6e048b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.idea/workspace.xml
+62
-22
62 additions, 22 deletions
.idea/workspace.xml
src/spotify/media/Media.java
+57
-0
57 additions, 0 deletions
src/spotify/media/Media.java
with
119 additions
and
22 deletions
.idea/workspace.xml
+
62
−
22
View file @
bb86ddf6
...
...
@@ -4,15 +4,22 @@
<option
name=
"autoReloadType"
value=
"SELECTIVE"
/>
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"0c5e7f40-d6e0-4cdf-8175-c288dac24af5"
name=
"Changes"
comment=
"
l
"
>
<change
afterPath=
"$PROJECT_DIR$/src/s
dis/utils/MultiMap
.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/
src/Main.java"
before
Dir=
"false"
/>
<list
default=
"true"
id=
"0c5e7f40-d6e0-4cdf-8175-c288dac24af5"
name=
"Changes"
comment=
"
Copias
"
>
<change
afterPath=
"$PROJECT_DIR$/src/s
potify/media/Media
.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/
.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
after
Dir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_NON_ACTIVE_CHANGELIST"
value=
"false"
/>
<option
name=
"LAST_RESOLUTION"
value=
"IGNORE"
/>
</component>
<component
name=
"FileTemplateManagerImpl"
>
<option
name=
"RECENT_TEMPLATES"
>
<list>
<option
value=
"Class"
/>
</list>
</option>
</component>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_BRANCH_BY_REPOSITORY"
>
<map>
...
...
@@ -30,23 +37,35 @@
<option
name=
"hideEmptyMiddlePackages"
value=
"true"
/>
<option
name=
"showLibraryContents"
value=
"true"
/>
</component>
<component
name=
"PropertiesComponent"
>
<![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "master",
"kotlin-language-version-configured": "true",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "Modules",
"project.structure.proportion": "0.0",
"project.structure.side.proportion": "0.0",
"vue.rearranger.settings.migration": "true"
<component
name=
"PropertiesComponent"
>
{
"
keyToString
"
: {
"
RunOnceActivity.OpenProjectViewOnStart
"
:
"
true
"
,
"
RunOnceActivity.ShowReadmeOnStart
"
:
"
true
"
,
"
git-widget-placeholder
"
:
"
master
"
,
"
kotlin-language-version-configured
"
:
"
true
"
,
"
last_opened_file_path
"
:
"
/home/ismael/IdeaProjects/practicasdis2/src/sdis/spotify/client/unit
"
,
"
node.js.detected.package.eslint
"
:
"
true
"
,
"
node.js.detected.package.tslint
"
:
"
true
"
,
"
node.js.selected.package.eslint
"
:
"
(autodetect)
"
,
"
node.js.selected.package.tslint
"
:
"
(autodetect)
"
,
"
nodejs_package_manager_path
"
:
"
npm
"
,
"
project.structure.last.edited
"
:
"
Modules
"
,
"
project.structure.proportion
"
:
"
0.0
"
,
"
project.structure.side.proportion
"
:
"
0.0
"
,
"
vue.rearranger.settings.migration
"
:
"
true
"
}
}]]>
</component>
}
</component>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<recent
name=
"$PROJECT_DIR$/src/sdis/spotify/client/unit"
/>
<recent
name=
"$PROJECT_DIR$/src/sdis/spotify/client"
/>
<recent
name=
"$PROJECT_DIR$/src/sdis/spotify/common"
/>
<recent
name=
"$PROJECT_DIR$/src/sdis/spotify/server"
/>
</key>
<key
name=
"CopyClassDialog.RECENTS_KEY"
>
<recent
name=
"sdis.utils"
/>
</key>
</component>
<component
name=
"SharedIndexes"
>
<attachedChunks>
<set>
...
...
@@ -63,7 +82,8 @@
<option
name=
"presentableId"
value=
"Default"
/>
<updated>
1715700916232
</updated>
<workItem
from=
"1715700917299"
duration=
"37000"
/>
<workItem
from=
"1715700981339"
duration=
"692000"
/>
<workItem
from=
"1715700981339"
duration=
"801000"
/>
<workItem
from=
"1716049349162"
duration=
"71000"
/>
</task>
<task
id=
"LOCAL-00001"
summary=
"l"
>
<option
name=
"closed"
value=
"true"
/>
...
...
@@ -73,14 +93,34 @@
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1715701180778
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"2"
/>
<task
id=
"LOCAL-00002"
summary=
"Copias"
>
<option
name=
"closed"
value=
"true"
/>
<created>
1715701766747
</created>
<option
name=
"number"
value=
"00002"
/>
<option
name=
"presentableId"
value=
"LOCAL-00002"
/>
<option
name=
"project"
value=
"LOCAL"
/>
<updated>
1715701766747
</updated>
</task>
<option
name=
"localTasksCounter"
value=
"3"
/>
<servers
/>
</component>
<component
name=
"TypeScriptGeneratedFilesManager"
>
<option
name=
"version"
value=
"3"
/>
</component>
<component
name=
"Vcs.Log.Tabs.Properties"
>
<option
name=
"TAB_STATES"
>
<map>
<entry
key=
"MAIN"
>
<value>
<State
/>
</value>
</entry>
</map>
</option>
</component>
<component
name=
"VcsManagerConfiguration"
>
<MESSAGE
value=
"l"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"l"
/>
<MESSAGE
value=
"Copias"
/>
<option
name=
"LAST_COMMIT_MESSAGE"
value=
"Copias"
/>
</component>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/spotify/media/Media.java
0 → 100644
+
57
−
0
View file @
bb86ddf6
package
spotify.media
;
import
javax.swing.*
;
import
java.awt.*
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
public
class
Media
implements
Serializable
{
private
String
name
;
private
String
internalName
;
private
int
likes
;
private
boolean
adultContent
;
private
ArrayList
<
String
>
comments
;
private
double
score
;
private
int
numVotes
;
private
ImageIcon
cover
;
public
Media
(
String
name
)
{
this
.
name
=
name
;
this
.
internalName
=
name
.
trim
().
replaceAll
(
"[^a-zA-Z0-9]+"
,
"_"
).
toLowerCase
();
this
.
likes
=
0
;
this
.
adultContent
=
false
;
this
.
comments
=
new
ArrayList
<>();
this
.
score
=
0
;
this
.
numVotes
=
0
;
this
.
cover
=
null
;
}
public
String
getName
(){
return
this
.
name
;
}
public
String
getInternalName
(){
return
this
.
internalName
;
}
public
int
getLikes
()
{
return
this
.
likes
;
}
public
boolean
isAdultContent
()
{
return
this
.
adultContent
;
}
public
ArrayList
<
String
>
getComments
()
{
return
this
.
comments
;
}
public
double
getScore
()
{
return
this
.
score
;
}
public
ImageIcon
getCover
()
{
return
this
.
cover
;
}
public
void
addLike
()
{
this
.
likes
++;
}
public
void
tagAdultContent
(
boolean
flag
)
{
this
.
adultContent
=
flag
;
}
public
void
addComment
(
String
comment
)
{
this
.
comments
.
add
(
comment
);
}
public
void
addScore
(
double
sc
)
{
score
=
(
(
score
*
numVotes
)
+
sc
)
/
(++
numVotes
);
}
public
void
setCover
(
ImageIcon
img
)
{
this
.
cover
=
img
;
}
public
String
toString
()
{
showCover
();
String
msg
=
"\n\n© "
+
this
.
name
+(
this
.
adultContent
?
" [+18]"
:
" [AP (all public)]"
)+
"."
;
msg
+=
"\n \u2606"
+
" "
+
Math
.
round
(
this
.
score
*
100
)/
100.0
+
" ("
+
this
.
numVotes
+
" votes)"
;
msg
+=
"\n \uD83D\uDC4D"
+
" "
+
this
.
likes
;
msg
+=
"\n "
+
this
.
comments
.
size
()+
" comments found on this media:"
;
for
(
int
i
=
0
;
i
<
this
.
comments
.
size
();
i
++)
msg
+=
" \n #"
+
i
+
": "
+
this
.
comments
.
get
(
i
)+
"."
;
return
msg
;
}
public
void
showCover
()
{
if
(
cover
==
null
)
return
;
JFrame
frame
=
new
JFrame
();
frame
.
setDefaultCloseOperation
(
JFrame
.
HIDE_ON_CLOSE
);
frame
.
add
((
new
JPanel
()).
add
(
new
JLabel
(
getCover
())));
frame
.
pack
();
frame
.
setVisible
(
true
);
}
public
void
loadCover
(
String
path
)
{
setCover
(
new
ImageIcon
(
Toolkit
.
getDefaultToolkit
().
createImage
(
path
)));
}
}
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